LoginwithSocial.js 2.74 KB
Newer Older
Spark's avatar
Spark committed
1
2
3
import React from 'react'
import '../App.css'
import { Form, Modal, Button, Row, Col, Image, Alert } from 'react-bootstrap';
4
5
6
7
import Oauth from '../components/Oauth';
import { useEffect } from 'react';
import axios from 'axios';
import { useState } from 'react';
Spark's avatar
Spark committed
8
9
10
11
12
13
14
15
16
17
18
19
20

function LoginwithSocial() {

    const inboxstyled = {
        display: 'flex',
        flexDirection: 'column',
        maxWidth: '100%',
        justifyContent: 'center',
        margin: 'auto',
        padding: '10px'

    }

21
22
23
24
25
26
27
    function loginWithKakao() {
        window.Kakao.Auth.authorize({
          redirectUri: 'http://localhost:3000/oauth'
        })
    }
    const [isLogin, setIsLogin] = useState(false)

Spark's avatar
Spark committed
28
    return (
29
30
        <Row className='m-auto'>
            <Modal.Header className='d-flex justify-content-center w-100'>
Spark's avatar
Spark committed
31
32
33
34
35
36
37
38
39
40
41
42
43
                <Modal.Title id="example-modal-sizes-title-sm">
                    LOGIN
                </Modal.Title>
            </Modal.Header>
            <Modal.Body>
                <Form style={inboxstyled}>
                    <Form.Group controlId="formBasicEmail">
                        <Form.Control type="email" placeholder="Email" />
                    </Form.Group>

                    <Form.Group controlId="formBasicPassword">
                        <Form.Control type="password" placeholder="Password" />
                    </Form.Group>
44
                    <Button variant='light' type="submit" id='formbtn'>
Spark's avatar
Spark committed
45
46
47
48
49
                        LOGIN
                    </Button>
                </Form>
                <hr />
                <Row style={{ margin: 'auto', marginBottom: '5px', display: 'flex', justifyContent: 'center' }}>
50
51
                    <a href="#" onClick={loginWithKakao} id='socialLink' >
                        <img src='/images/Kakao1.jpg' id='logpng' />
Spark's avatar
Spark committed
52
53
                        KAKAO
                    </a>
54
55
56
57
58
59
60
61
                    <a href="javascript:loginWithKakao()" id='socialLink' >
                        <img src='/images/Kakao1.jpg' id='logpng' />
                        KAKAOHTML
                    </a>
                    <a href="javascript:loginWithKakaoPOP()" id='socialLink' >
                        <img src='/images/Kakao1.jpg' id='logpng' />
                        KAKAOPOP
                    </a>
Spark's avatar
Spark committed
62
63
64
65
66
67
68
69
70
71
                    <a as='button' href="javascript:loginWithKakao()" id='socialLink'>
                        <Image src='/images/google.png' id='logpng' />
                        GOOGLE
                    </a>
                    <a as='button' href="javascript:loginWithKakao()" id='socialLink'>
                        <Image src='/images/facebook.png' id='logpng' />
                        FACEBOOK
                    </a>
                </Row>
            </Modal.Body>
72
        </Row>
Spark's avatar
Spark committed
73
74
75
76
    )
}

export default LoginwithSocial;