Skip to content

Commit

Permalink
Merge pull request #13 from Gateway-DAO/feat/profile-edit
Browse files Browse the repository at this point in the history
profile editing pages
  • Loading branch information
fbenfraj authored Jun 13, 2022
2 parents 6b22f2d + eb06403 commit 565e81b
Show file tree
Hide file tree
Showing 8 changed files with 875 additions and 0 deletions.
32 changes: 32 additions & 0 deletions apps/website/__mock__/daos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,35 @@ export const temporaryDao: Dao = {
id: '999',
name: 'Temporary Dao',
};


export const temporaryKnowledge = [
{ key: 1, label: 'The Shawshank Redemption' },
{ key: 2, label: 'The Godfather' },
{ key: 3, label: 'The Godfather: Part II' },
{ key: 4, label: 'The Dark Knight' },
{ key: 5, label: '12 Angry Men' },
{ key: 6, label: "Schindler's List" },
{ key: 7, label: 'Pulp Fiction' },
{ key: 8, label: 'Don' }
]
export const temporarySkills = [
{ key: 1, label: 'The Shawshank Redemption' },
{ key: 2, label: 'The Godfather' },
{ key: 3, label: 'The Godfather: Part II' },
{ key: 4, label: 'The Dark Knight' },
{ key: 5, label: '12 Angry Men' },
{ key: 6, label: "Schindler's List" },
{ key: 7, label: 'Pulp Fiction' },
{ key: 8, label: 'Don' }
]
export const temporaryAttitudes = [
{ key: 1, label: 'The Shawshank Redemption' },
{ key: 2, label: 'The Godfather' },
{ key: 3, label: 'The Godfather: Part II' },
{ key: 4, label: 'The Dark Knight' },
{ key: 5, label: '12 Angry Men' },
{ key: 6, label: "Schindler's List" },
{ key: 7, label: 'Pulp Fiction' },
{ key: 8, label: 'Don' }
]
129 changes: 129 additions & 0 deletions apps/website/pages/profile/edit-attitudes.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
import { Box, Button, Container, Grid, Typography } from "@mui/material";
import ArrowBackIcon from '@mui/icons-material/ArrowBack';

import React, { useState } from "react";
import TextField from '@mui/material/TextField';
import Autocomplete from '@mui/material/Autocomplete';
import { temporaryAttitudes } from "apps/website/__mock__/daos";
import CloseIcon from '@mui/icons-material/Close';



const editAttitudes = () => {



const [attitude, setAttitude] = useState([]);

const [value, setValue] = useState('');

const [inputValue, setInputValue] = React.useState('');



return (
<Container>
<Box style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', width: '100%', margin: '30px 0' }}>
<div style={{ background: "rgba(255,255,255,0.15)", padding: '8px', height: "42px", borderRadius: 100 }} >
<ArrowBackIcon />
</div>
<div>
<Button variant="outlined" style={{ marginRight: 10 }}>Cancel</Button>
<Button variant="contained">Save</Button>
</div>
</Box>
<Box>
<Typography variant="h4">Edit Skills</Typography>
</Box>
<br />
<br />
<br />
<Grid container spacing={5} >
<Grid item xs={12} md={4}>
<Typography variant="h6">Skills</Typography>
<Typography variant="body2" style={{ fontWeight: 300, padding: '2px 0', fontSize: 13 }}>Lorem ispum doler sit amet</Typography>
</Grid>
<Grid item xs={12} md={4} >
<Box>
<Autocomplete
id="combo-box-demo"
options={temporaryAttitudes}
sx={{ width: 300 }}

value={value}
onChange={(event: any, newValue: string | null) => {
setValue(newValue);
}}



inputValue={inputValue}
onInputChange={(event, newInputValue) => {
setInputValue(newInputValue);
}}


onKeyDown={(e) => {
if (e.key === 'Enter') {
console.log('working', attitude, value, inputValue);
let newArr = [...attitude];
newArr.push(value);
setAttitude(newArr);
}
}}


renderInput={(params) =>
<TextField {...params} label="SEARCH" onChange={(e) => {
setValue(e.target.value)
console.log(e.target.value)
}} />}
/>
<Box style={{ margin: '20px 0', display: 'flex', alignItems: 'center', justifyContent: 'space-between', flexWrap: 'wrap' }} >
{
attitude.map((item) => {
return (
<div
key={item.key}
style={{ borderRadius: 100, display: 'flex', justifyContent: "space-between", alignItems: 'center', background: "rgba(255,255,255, .25)", padding: '6px 12px', marginTop: 10, marginRight: 10 }}
>
<Typography style={{ marginRight: 6, fontSize: 14 }}>{item.label}</Typography>
<CloseIcon style={{ fontSize: 24, marginLeft: 'auto' }}
onClick={() => {
let newArr = [...attitude];
for (let i = 0; i < newArr.length; i++) {
if (newArr[i].key === item.key) {
newArr.splice(i, 1);
}
}
setAttitude(newArr);
console.log(newArr);
}}
/>
</div>
)
})}
</Box>
<Box>
<Typography variant="h6" style={{ fontSize: 14, fontWeight: 600, margin: '10px 2px' }}>RECOMMENDATIONS</Typography>
</Box>
<Box style={{ margin: '20px 0' }} >
<Box style={{ display: 'flex', justifyContent: 'space-between', margin: "10px 0" }}>
<div style={{ borderRadius: 100, display: 'flex', justifyContent: "space-between", alignItems: 'center', background: "rgba(255,255,255, .25)", padding: '12px', marginRight: 10 }}>
<span style={{ marginRight: 6, fontSize: 13 }}>Skills 1</span>
<CloseIcon style={{ fontSize: 24 }} />
</div>
</Box>
</Box>
</Box>
</Grid>
</Grid>

</Container>
);
}

export default editAttitudes;



143 changes: 143 additions & 0 deletions apps/website/pages/profile/edit-knowledge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
import { Box, Button, Container, Grid, Typography } from "@mui/material";
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
import React, { useState } from "react";
import TextField from '@mui/material/TextField';
import Autocomplete from '@mui/material/Autocomplete';
import CloseIcon from '@mui/icons-material/Close';

import { temporaryKnowledge } from "apps/website/__mock__/daos";


const editKnowledge = () => {

const [Knowledges, setKnowledges] = useState([]);

const [value, setValue] = useState('');

const [inputValue, setInputValue] = React.useState('');


return (
<div>
<Container>
<Box style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', width: '100%', margin: '30px 0' }}>
<div style={{ background: "rgba(255,255,255,0.15)", padding: '8px', height: "42px", borderRadius: 100 }} >
<ArrowBackIcon />
</div>
<div>
<Button variant="outlined" style={{ marginRight: 10 }}>Cancel</Button>
<Button variant="contained">Save</Button>
</div>
</Box>
<Box>
<Typography variant="h4">Edit Knowledges</Typography>
</Box>
<br />
<br />
<br />
<Grid container spacing={5} >
<Grid item xs={12} md={4}>
<Typography variant="h6">Knowledges</Typography>
<Typography variant="body2" style={{ fontWeight: 300, padding: '2px 0', fontSize: 13 }}>Lorem ispum doler sit amet</Typography>
</Grid>
<Grid item xs={12} md={4} >
<Box>

<Autocomplete
id="combo-box-demo"
options={temporaryKnowledge}
sx={{ width: 300 }}

value={value}
onChange={(event: any, newValue: string | null) => {
setValue(newValue);
}}



inputValue={inputValue}
onInputChange={(event, newInputValue) => {
setInputValue(newInputValue);
}}


onKeyDown={(e) => {
if (e.key === 'Enter') {
console.log('working', Knowledges, value, inputValue);
let newArr = [...Knowledges];
newArr.push(value);
setKnowledges(newArr);
}
}}


renderInput={(params) =>
<TextField {...params} label="SEARCH" onChange={(e) => {
setValue(e.target.value)
console.log(e.target.value)
}} />}
/>

<Box style={{ margin: '20px 0', display: 'flex', alignItems: 'center', justifyContent: 'space-between', flexWrap: 'wrap' }} >
{
Knowledges.map((item) => {
return (
<div
key={item.key}
style={{ borderRadius: 100, display: 'flex', justifyContent: "space-between", alignItems: 'center', background: "rgba(255,255,255, .25)", padding: '6px 12px', marginTop: 10, marginRight: 10 }}
>
<Typography style={{ marginRight: 6, fontSize: 14 }}>{item.label}</Typography>
<CloseIcon style={{ fontSize: 24, marginLeft: 'auto' }}
onClick={() => {
let newArr = [...Knowledges];
for (let i = 0; i < newArr.length; i++) {
if (newArr[i].key === item.key) {
newArr.splice(i, 1);
}
}
setKnowledges(newArr);
console.log(newArr);
}}
/>
</div>
)
})}
</Box>

<Box>
<Typography variant="h6" style={{ fontSize: 14, fontWeight: 600, margin: '10px 2px' }}>RECOMMENDATIONS</Typography>
</Box>
<Box style={{ margin: '20px 0' }} >
<Box style={{ display: 'flex', justifyContent: 'space-between', margin: "10px 0" }}>
<div style={{ borderRadius: 100, display: 'flex', justifyContent: "space-between", alignItems: 'center', background: "rgba(255,255,255, .25)", padding: '10px 12px', marginRight: 10 }}>
<Typography style={{ marginRight: 6, fontSize: 13 }}>Skills 1</Typography>
<CloseIcon style={{ fontSize: 24 }} />
</div>
</Box>
</Box>
</Box>
</Grid>
</Grid>

</Container>
</div>
);
}

export default editKnowledge;



const top100Films = [
{ label: 'The Shawshank Redemption', year: 1994 },
{ label: 'The Godfather', year: 1972 },
{ label: 'The Godfather: Part II', year: 1974 },
{ label: 'The Dark Knight', year: 2008 },
{ label: '12 Angry Men', year: 1957 },
{ label: "Schindler's List", year: 1993 },
{ label: 'Pulp Fiction', year: 1994 },
{
label: 'The Lord of the Rings: The Return of the King',
year: 2003,
}
]
Loading

0 comments on commit 565e81b

Please sign in to comment.