generated from ita-social-projects/DevTemplate
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #219 from ita-social-projects/#186connectWithSWR
#186connect with swr
- Loading branch information
Showing
11 changed files
with
139 additions
and
61 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
88 changes: 88 additions & 0 deletions
88
FrontEnd/src/components/ProfilePage/FormComponents/FormFields/OneSelectChip.js
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,88 @@ | ||
import css from './MultipleSelectChip.module.css'; | ||
import Box from '@mui/material/Box'; | ||
import Chip from '@mui/material/Chip'; | ||
import FormControl from '@mui/material/FormControl'; | ||
import InputLabel from '@mui/material/InputLabel'; | ||
import MenuItem from '@mui/material/MenuItem'; | ||
import OutlinedInput from '@mui/material/OutlinedInput'; | ||
import Select from '@mui/material/Select'; | ||
import { useTheme } from '@mui/material/styles'; | ||
|
||
|
||
const ITEM_HEIGHT = 48; | ||
const ITEM_PADDING_TOP = 8; | ||
const MenuProps = { | ||
PaperProps: { | ||
style: { | ||
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP, | ||
width: 250, | ||
}, | ||
}, | ||
}; | ||
|
||
function getStyles(name, selectedOptions, theme) { | ||
return { | ||
fontWeight: | ||
selectedOptions.indexOf(name) === -1 | ||
? theme.typography.fontWeightRegular | ||
: theme.typography.fontWeightMedium, | ||
}; | ||
} | ||
|
||
export default function OneSelectChip(props) { | ||
const theme = useTheme(); | ||
return ( | ||
<div className={css['fields__column']}> | ||
<div className={css['fields__label']}> | ||
{props.requredField && <label className={css['fields__label--required']}>*</label>} | ||
<label | ||
className={`${css['fields__label--text']} ${!props.requredField && css['fields__field--notrequired']}`} | ||
> | ||
{props.label} | ||
</label> | ||
</div> | ||
<FormControl sx={{ width: props.selectedWidth ? props.selectedWidth : 257}} size='small' > | ||
<InputLabel id="demo-multiple-chip-label" className={css['choose__placeholder']}>{props.defaultValue}</InputLabel> | ||
<Select | ||
name={props.name} | ||
labelId="demo-multiple-chip-label" | ||
id="demo-multiple-chip" | ||
value={props.value} | ||
onChange={props.updateHandler} | ||
input={<OutlinedInput id="select-multiple-chip" label={props.defaultValue} />} | ||
renderValue={(selected) => ( | ||
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 0.5 }}> | ||
<Chip | ||
label={selected} | ||
sx={{color: '#1F9A7C', backgroundColor: 'white', border: '1px solid #1F9A7C'}}/> | ||
</Box> | ||
)} | ||
MenuProps={MenuProps} | ||
> | ||
{props.options.map((option) => ( | ||
<MenuItem | ||
key={option.key} | ||
value={option.value} | ||
style={{ | ||
...getStyles(option.value, props.value, theme), | ||
fontFamily: 'Inter, sans-serif', | ||
fontSize: '14px', | ||
fontWeight: 400, | ||
lineHeight: '20px', | ||
letterSpacing: '-0.01em', | ||
backgroundColor: props.value.includes(option.name) && '#A3AAB0', | ||
}} | ||
> | ||
{option.value} | ||
</MenuItem> | ||
))} | ||
</Select> | ||
</FormControl> | ||
{props.requredField && | ||
<div className={css['error-message']}> | ||
{props.error} | ||
</div> | ||
} | ||
</div> | ||
); | ||
} |
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
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
1 change: 0 additions & 1 deletion
1
FrontEnd/src/components/SignUp/components/signup/signup-form/SignUpFormContent.js
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
11 changes: 0 additions & 11 deletions
11
FrontEnd/src/components/landing-page/companies/Companies.js
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
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