Skip to content

Commit f7b2883

Browse files
committed
add base fields
1 parent 75d2804 commit f7b2883

File tree

14 files changed

+315
-69
lines changed

14 files changed

+315
-69
lines changed

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
API_URL_A=https://forautobackend.herokuapp.com
2-
API_URL=http://localhost:3030
1+
API_URL=http://localhost
2+
ENV=development

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# API_URL=https://forautobackend.herokuapp.com
2+
API_URL=http://localhost
3+
ENV=development

components/AuthForm/parts/SignInForm.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
FacebookButton,
1515
LanguageList,
1616
} from '~components'
17+
import config from '../../../config'
1718

1819
const formName = 'signInForm'
1920

@@ -25,14 +26,14 @@ const Component = ({ handleSubmit, onSubmit, children, title }) => {
2526
{title && <h4>{title}</h4>}
2627
<div className={styles.social}>
2728
<GoogleButton
28-
title="Sign in with Google"
29-
href="https://forautobackend.herokuapp.com/oauth/google"
29+
title={t('button.signInWithGoogle')}
30+
href={config.oauthUrls.google}
3031
/>
3132
</div>
3233
<div className={styles.social}>
3334
<FacebookButton
34-
title="Sign in with Facebook"
35-
href="https://forautobackend.herokuapp.com/oauth/facebook"
35+
title={t('button.signInWithFacebook')}
36+
href={config.oauthUrls.facebook}
3637
/>
3738
</div>
3839
{children}

components/AuthForm/parts/SignUpForm.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
GoogleButton,
1111
FacebookButton,
1212
} from '~components'
13+
import config from '../../../config'
1314

1415
const formName = 'signUpForm'
1516

@@ -19,7 +20,7 @@ const Component = ({ onSubmit, children, handleSubmit, title }) => {
1920
return (
2021
<form className={styles.container}>
2122
<div className={styles.disclaimer}>
22-
<span>🤞 We do not share any of your personal information with third parties.</span>
23+
<span>{t('titles.registrationDisclaimer')}</span>
2324
</div>
2425
{title && <h4>{title}</h4>}
2526
{/* {children}
@@ -28,15 +29,15 @@ const Component = ({ onSubmit, children, handleSubmit, title }) => {
2829
</Button> */}
2930
<div className={styles.social}>
3031
<GoogleButton
31-
title="Sign up with Google"
32-
href="https://forautobackend.herokuapp.com/oauth/google"
32+
title={t('button.signUpWithGoogle')}
33+
href={config.oauthUrls.google}
3334
/>
3435
</div>
3536

3637
<div className={styles.social}>
3738
<FacebookButton
38-
title="Sign up with Facebook"
39-
href="https://forautobackend.herokuapp.com/oauth/facebook"
39+
title={t('button.signUpWithFacebook')}
40+
href={config.oauthUrls.facebook}
4041
/>
4142
</div>
4243
<Spacer className={styles.spacer} />

components/Button/Button.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class Button extends React.PureComponent {
99
static types = {
1010
PRIMARY: 'primary',
1111
GHOST: 'ghost',
12+
TEXT: 'text',
1213
}
1314

1415
static colors = {
@@ -72,7 +73,7 @@ Button.propTypes = {
7273
label: PropTypes.string,
7374
className: PropTypes.string,
7475
visible: PropTypes.bool,
75-
type: PropTypes.oneOf(['primary', 'ghost']),
76+
type: PropTypes.oneOf(['primary', 'ghost', 'text']),
7677
color: PropTypes.oneOf(['green', 'white', 'red']),
7778
icon: PropTypes.string,
7879
disabled: PropTypes.bool,

components/Button/Button.module.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@
6161
border: 1px solid $color-dark-gray;
6262
}
6363

64+
65+
6466
.ghost {
6567
border: $border-primary;
6668
color: $color-primary;
@@ -85,6 +87,20 @@
8587
}
8688
}
8789

90+
.text {
91+
border: none;
92+
background: transparent;
93+
color: $color-primary;
94+
border-radius: none;
95+
font-weight: $font-weight-bold;
96+
&:hover {
97+
text-decoration: underline;
98+
}
99+
&.red {
100+
color: $color-red;
101+
}
102+
}
103+
88104
.iconOnly {
89105
width: 38px;
90106
height: 38px;

components/Header/DesktopHeader.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
Button,
1919
BaseButton,
2020
NavigationDropdown,
21+
LanguageList,
2122
} from '~components'
2223
import LogoIcon from '~public/logo.svg'
2324
import HeaderActionIcon from './HeaderActionIcon'
@@ -85,15 +86,15 @@ const DesktopHeader = () => {
8586
}
8687
return (
8788
<section>
88-
<LanguageSwitch />
8989
<Button
9090
isInternalLink
91-
href="/sign-in"
92-
type={Button.types.PRIMARY}
93-
className={classNames(styles.spacingLarge, styles.actionButton)}
91+
href="/sign-up"
92+
type="text"
93+
className={styles.actionButton}
9494
>
95-
{t('button.signIn')}
95+
{t('button.signUp')}
9696
</Button>
97+
<LanguageSwitch className={styles.spacingLarge} />
9798
<NavigationDropdown open={drawerOpen} setOpen={setDrawerOpen}>
9899
<BaseButton
99100
onClick={() => setDrawerOpen(!drawerOpen)}

components/Header/DesktopHeader.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
}
131131

132132
.actionButton {
133-
padding: 0 spacing(2);
133+
padding: 0;
134134
min-height: unset;
135135
height: 34px;
136136
}

components/LanguageSwitch/LanguageSwitch.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ const languages = {
2828
},
2929
}
3030

31-
const Drawer = React.memo(() => {
31+
const Drawer = React.memo(({open}) => {
3232
const { i18n } = useTranslation()
3333
const { language = 'en' } = i18n
34+
if (!open) return null
3435
return (
3536
<div className={styles.drawer}>
3637
{map(languages, (lang, key) => {
@@ -56,13 +57,13 @@ const LanguageSwitch = ({ className }) => {
5657
const { i18n } = useTranslation()
5758
const { language = 'en' } = i18n
5859
useOutsideClick({ ref, isOpen: open, setOpen })
59-
if (!open) return null
60+
// if (!open) return null
6061
return (
6162
<div className={classNames(styles.container, className)} ref={ref}>
6263
<BaseButton onClick={() => setOpen(!open)}>
6364
{languages[language].icon}
6465
</BaseButton>
65-
<Drawer />
66+
<Drawer open={open} />
6667
</div>
6768
)
6869
}

components/LanguageSwitch/LanguageSwitch.module.scss

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,31 @@
1212
}
1313
}
1414

15+
@keyframes appear {
16+
0% {
17+
transform: scale(0) translate(0, 100%);
18+
opacity: 0;
19+
visibility: visible;
20+
}
21+
80% {
22+
transform: scale(1.2) translate(0, 100%);
23+
}
24+
100% {
25+
transform: scale(1) translate(0, 100%);
26+
opacity: 1;
27+
}
28+
}
29+
1530
.container {
1631
position: relative;
1732
.drawer {
18-
animation: slideInDown .3s ease-in-out;
33+
animation: appear .6s ease-in-out;
1934
animation-fill-mode: forwards;
2035
position: absolute;
21-
bottom: - spacing(2);
22-
transform: translate(0, 100%);
36+
bottom: 0;
2337
left: -100%;
2438
min-height: 44px;
39+
transform: translate(0, -100%);
2540
padding: spacing(1) 0;
2641
min-width: 80px;
2742
background-color: $color-dark;

0 commit comments

Comments
 (0)