-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create createPool component, add: buttons, input field for numbers, h…
…eader for form #8
- Loading branch information
Showing
25 changed files
with
442 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
frontend/src/components/UI/buttonPrimary/ButtonPrimary.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
.button { | ||
position: relative; | ||
min-height: 60px; | ||
border: none; | ||
border-radius: 8px; | ||
padding: 16px 20px; | ||
color: var(--dark-on-primary); | ||
background-color: var(--accent-color); | ||
font-size: 22px; | ||
line-height: 1.27; | ||
font-weight: 500; | ||
width: 100%; | ||
cursor: pointer; | ||
|
||
&::after { | ||
position: absolute; | ||
content: ''; | ||
left: 0; | ||
top: 0; | ||
width: 100%; | ||
height: 100%; | ||
opacity: 0; | ||
visibility: hidden; | ||
display: block; | ||
z-index: 2; | ||
border-radius: 8px; | ||
transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out, visibility 0.2s ease-in-out; | ||
} | ||
|
||
&:hover:not([disabled])::after { | ||
opacity: 1; | ||
visibility: visible; | ||
background-color: rgba(56, 30, 114, 0.08); | ||
transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out, visibility 0.2s ease-in-out; | ||
} | ||
|
||
&:active:not([disabled])::after { | ||
opacity: 1; | ||
visibility: visible; | ||
background-color: rgba(56, 30, 114, 0.16); | ||
color: rgba(var(--dark-on-primary-rgb), 0.38); | ||
} | ||
|
||
&:disabled { | ||
cursor: auto; | ||
background-color: rgba(230, 224, 233, 0.12); | ||
} | ||
|
||
&:active:not([disabled]) &__inner { | ||
opacity: 0.38; | ||
z-index: 3; | ||
} | ||
|
||
&:disabled &__inner { | ||
color: var(--neon-silver); | ||
opacity: 0.38; | ||
z-index: 3; | ||
} | ||
|
||
&.styles_inherit { | ||
width: inherit; | ||
height: inherit; | ||
min-height: inherit; | ||
border-radius: inherit; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
frontend/src/components/UI/buttonPrimary/ButtonPrimary.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import cn from 'classnames'; | ||
import styles from './ButtonPrimary.module.scss'; | ||
import { RefObject } from 'react'; | ||
|
||
export interface IButtonPrimary extends React.ButtonHTMLAttributes<HTMLButtonElement> { | ||
btnRef?: RefObject<HTMLButtonElement>; | ||
children: React.ReactNode; | ||
stylesInherit?: boolean; | ||
} | ||
|
||
export default function ButtonPrimary(props: IButtonPrimary) { | ||
const { btnRef, children, stylesInherit = false, ...btnProps } = props; | ||
|
||
return ( | ||
<button | ||
type='button' | ||
className={cn(styles.button, stylesInherit && styles.styles_inherit)} | ||
ref={btnRef} | ||
{...btnProps} | ||
> | ||
<span className={styles.button__inner}>{children}</span> | ||
</button> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
.button { | ||
position: relative; | ||
min-height: 36px; | ||
border: none; | ||
border-radius: 8px; | ||
padding: 8px 12px; | ||
color: #fff; | ||
background-color: #BF0021; | ||
font-size: 14px; | ||
line-height: 1.428; | ||
font-weight: 400; | ||
width: auto; | ||
cursor: pointer; | ||
|
||
&::after { | ||
position: absolute; | ||
content: ''; | ||
left: 0; | ||
top: 0; | ||
width: 100%; | ||
height: 100%; | ||
opacity: 0; | ||
visibility: hidden; | ||
display: block; | ||
z-index: 2; | ||
border-radius: 8px; | ||
transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out, visibility 0.2s ease-in-out; | ||
} | ||
|
||
&:hover:not([disabled])::after { | ||
opacity: 1; | ||
visibility: visible; | ||
background-color: rgba(var(--disabled-bg-rgb), 0.08); | ||
transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out, visibility 0.2s ease-in-out; | ||
} | ||
|
||
&:active:not([disabled])::after { | ||
opacity: 1; | ||
visibility: visible; | ||
background-color: rgba(var(--disabled-bg-rgb), 0.16); | ||
} | ||
|
||
&:active:not([disabled]) &__inner { | ||
color: rgba(255, 255, 255, 0.38); | ||
opacity: 0.38; | ||
z-index: 3; | ||
} | ||
|
||
&:disabled { | ||
cursor: auto; | ||
background-color: rgba(var(--disabled-bg-rgb), 0.12); | ||
} | ||
|
||
&:disabled &__inner { | ||
color: var(--neon-silver); | ||
opacity: 0.38; | ||
z-index: 3; | ||
} | ||
|
||
&.styles_inherit { | ||
width: inherit; | ||
height: inherit; | ||
min-height: inherit; | ||
border-radius: inherit; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import styles from './ButtonSm.module.scss'; | ||
import { RefObject } from 'react'; | ||
|
||
interface IButtonSm extends React.ButtonHTMLAttributes<HTMLButtonElement> { | ||
btnRef?: RefObject<HTMLButtonElement>; | ||
children: React.ReactNode; | ||
} | ||
|
||
function ButtonSm(props: IButtonSm) { | ||
const { btnRef, children, ...btnProps } = props; | ||
|
||
return ( | ||
<button type='button' className={styles.button} ref={btnRef} {...btnProps}> | ||
<span className={styles.button__inner}>{children}</span> | ||
</button> | ||
); | ||
} | ||
|
||
export default ButtonSm; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.create_pool { | ||
flex-grow: 1; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
|
||
&__box { | ||
max-width: 920px; | ||
width: 100%; | ||
padding: 24px; | ||
margin-top: 32px; | ||
background-color: #1B1B1F; | ||
box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.30), 0px 4px 8px 3px rgba(0, 0, 0, 0.15); | ||
border-radius: 16px; | ||
} | ||
|
||
&__form { | ||
margin-top: 32px; | ||
gap: 32px 0; | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import styles from './CreatePool.module.scss'; | ||
import ButtonPrimary from '../UI/buttonPrimary/ButtonPrimary'; | ||
import FormHeader from './formHeader/FormHeader'; | ||
import InputField from '../inputField/InputField'; | ||
import FormElTitle from '../formElTitle/FormElTitle'; | ||
|
||
function CreatePool() { | ||
return ( | ||
<div className={styles.create_pool}> | ||
<div className={styles.create_pool__box}> | ||
<div className={styles.create_pool__header}> | ||
<FormHeader linkText='Your assets' title='Create Pool' /> | ||
</div> | ||
<form className={styles.create_pool__form}> | ||
<div className={styles.create_pool__form_el}> | ||
<FormElTitle>Operator fee</FormElTitle> | ||
<InputField type='number' min={0} max={100} handleInputOnChange={() => {}} /> | ||
</div> | ||
<ButtonPrimary>Preview</ButtonPrimary> | ||
</form> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default CreatePool; |
29 changes: 29 additions & 0 deletions
29
frontend/src/components/createPool/formHeader/FormHeader.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.form_header { | ||
padding-bottom: 32px; | ||
border-bottom: 1px solid #A3CDDC; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
|
||
&__link { | ||
color: #43474E; | ||
font-size: 16px; | ||
font-weight: 400; | ||
line-height: 1.5; | ||
letter-spacing: 0.25px; | ||
display: flex; | ||
align-items: center; | ||
|
||
&_icon { | ||
margin-right: 8px; | ||
} | ||
} | ||
|
||
&__title { | ||
font-size: 28px; | ||
line-height: 1.28; | ||
font-family: 'Roboto', sans-serif; | ||
color: #FFF; | ||
font-weight: 400; | ||
} | ||
} |
Oops, something went wrong.