Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Frontend] Create Profile Card Component #296

Closed
Tracked by #295
PrerakMathur20 opened this issue Aug 10, 2022 · 0 comments · Fixed by #298
Closed
Tracked by #295

[Frontend] Create Profile Card Component #296

PrerakMathur20 opened this issue Aug 10, 2022 · 0 comments · Fixed by #298
Assignees
Labels
gsoc-2022 Google Summer of Code 2022

Comments

@PrerakMathur20
Copy link
Contributor

Profile Card Design

A Profile Card Component has to be designed and coded for the /dashboard and /profile routes.

Sub-Issue of #295

It should look something like the TaskCard as found here -

function TaskCard({ id, title, description, due_on, is_completed }) {
const classes = useStyles()
const auth = useSelector(state => state.auth)
const dispatch = useDispatch()
const history = useHistory()
// toggle is_completed true of false function
function toggleComplete(id, is_completed) {
dispatch(updateTask(id, is_completed, history))
history.push('amdin/task/list')
}
return (
<Container component="main" className={classes.root}>
<Typography
variant="h5"
component="h2"
className={classes.title}>
{title}
</Typography>
<Typography
variant="body1"
component="h4"
className={classes.date}>
{due_on}
</Typography>
<Typography
variant="body1"
component="h4"
className={classes.bodyText}>
{description}
</Typography>
<Typography
variant="body1"
component="h4"
className={classes.bodyText}>
{
(is_completed) ? (<span>Completed</span>) : (<span>Not Completed</span>)
}
</Typography>
{/* Button to mask task completed */}
{
(auth.user.role === "admin") ?
(<Button
variant="contained"
color="primary"
onClick={() => toggleComplete(id, is_completed)}>
{
(is_completed) ? (<span>Mark Incomplete</span>) : (<span>Mark Complete</span>)
}
</Button>)
: null
}
</Container>
)
}

It preferably should look like this -

Group 1

Here's the Figma link for the same:
https://www.figma.com/file/I5D5qoMrLMWyxCZGcBGDkG/OpenMF-ProfileCard?node-id=101%3A11

@PrerakMathur20 PrerakMathur20 self-assigned this Aug 21, 2022
@PrerakMathur20 PrerakMathur20 added the gsoc-2022 Google Summer of Code 2022 label Sep 5, 2022
@PrerakMathur20 PrerakMathur20 changed the title Create Profile Card Component [Frontend}Create Profile Card Component Sep 11, 2022
@PrerakMathur20 PrerakMathur20 changed the title [Frontend}Create Profile Card Component [Frontend] Create Profile Card Component Sep 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gsoc-2022 Google Summer of Code 2022
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant