Fakultas Ilmu Komputer UI

Commit 86dda5f2 authored by Muhammad Fakhrillah Abdul Azis's avatar Muhammad Fakhrillah Abdul Azis
Browse files

Merge branch '1606917531-54' into 'master'

1606917531 54

See merge request !86
parents 4b5fc965 19ef81fc
Pipeline #23004 passed with stages
in 10 minutes and 54 seconds
......@@ -321,5 +321,7 @@ assets/bundles/*
test/*
.tmp/
# package-lock.json
package-lock.json
# MacOS related files
.DS_Store
\ No newline at end of file
.DS_Store
import React from 'react';
import { Grid, Segment, Header, Card, Image } from 'semantic-ui-react';
import { Grid, Segment, Header, Card, Image, Button } from 'semantic-ui-react';
import LoginForm from './components/LoginForm';
import CompanyRegisterModal from './components/CompanyRegisterModal';
import Footer from './components/Footer';
import InfoModal from './components/InfoModal';
export default class Login extends React.Component {
constructor() {
super();
this.state = {
activeForm: 'user',
};
}
static defaultProps = {
children: null,
};
......@@ -17,6 +25,36 @@ export default class Login extends React.Component {
]),
};
renderForm() {
if (this.state.activeForm == 'company') {
return (
<Segment basic>
<LoginForm
type="company"
header="Company Login"
imgSrc="logo.png"
imgSize="small"
usernameLabel="Email"
/>
{this.props.children}
<div style={{display: 'flex', justifyContent:'center', alignItems:'center', marginTop:'5px'}}>
<Button primary onClick={() => this.setState({activeForm : 'user'})}> Login as User </Button>
</div>
</Segment >
)
} else if (this.state.activeForm == 'user') {
return (
<Segment basic>
<LoginForm type="sso-ui" header="SSO Login" imgSrc="UI.png" imgSize="tiny" />
{this.props.children}
<div style={{display: 'flex', justifyContent:'center', alignItems:'center', marginTop:'5px'}}>
<Button primary onClick={() => this.setState({activeForm : 'company'})}> Login as Company </Button>
</div>
</Segment>
)
}
}
render = () => (
<div className="halamanLogin">
<div className="headerLogin">
......@@ -29,24 +67,8 @@ export default class Login extends React.Component {
<Grid stackable columns={2} padded style={{ display: 'flex', justifyContent: 'center' }}>
<Grid.Column width="seven">
<Segment basic>
<LoginForm type="sso-ui" header="SSO Login" imgSrc="UI.png" imgSize="tiny" />
{this.props.children}
</Segment>
</Grid.Column>
<Grid.Column width="seven">
<Segment basic>
<LoginForm
type="company"
header="Company Login"
imgSrc="logo.png"
imgSize="small"
usernameLabel="Email"
/>
{this.props.children}
</Segment>
{this.renderForm()}
<div className="register">
<Card centered className="register">
<Card.Content>
......
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2019-10-10 15:49
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0017_vacancy_amount'),
('core', '0014_auto_20191004_1340'),
('core', '0019_merge_20191006_0852'),
]
operations = [
]
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2019-10-12 03:18
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0053_merge_20191012_0832'),
('core', '0020_merge_20191010_2249'),
]
operations = [
]
......@@ -102,11 +102,11 @@ DATABASES = {
TEST_DATABASE = {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'kape',
'USER': 'kape',
'PASSWORD': 'kape',
'HOST': 'localhost',
'PORT': '5432',
'NAME': os.getenv('KAPE_DB_NAME', 'kape'),
'USER': os.getenv('KAPE_DB_USER', 'kape'),
'PASSWORD': os.getenv('KAPE_DB_PASSWORD', 'kape'),
'HOST': os.getenv('KAPE_DB_HOST', 'localhost'),
'PORT': os.getenv('KAPE_DB_PORT', '5432'),
}
CI_DATABASE = {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment