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

Created RoleCard Component #1129

Merged
merged 3 commits into from
May 23, 2023

Conversation

rinagobo
Copy link
Contributor

  • Added RoleCard.js
  • Added StyledRoleCard.js
  • Added the code below in UserOnboardingModal.js
    <RoleCard iconImg={"Onboarding"} title={"Developer"} subtitle={"You are here to work on our codebase"} theme={"theme1"} />

@rinagobo rinagobo requested a review from judeamos May 17, 2023 21:08
@changeset-bot
Copy link

changeset-bot bot commented May 17, 2023

⚠️ No Changeset found

Latest commit: d9d9387

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

import React from 'react'
import { RoleCardContainer, PicWrapper, TextContents, IconImg} from './StyledRoleCard'

// @description This component renders the RoleCard Component.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can comment in multiple lines using /** @description ....comment */

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Completed.

return (
<RoleCardContainer>

<PicWrapper>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this styled component to 'IconWrapper', this explains the code better

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Completed.


export const RoleCardContainer = styled.div`
margin-top: 50px;
/* Components */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure if this is the right type of comments for this, but if your not receiving any errors, then this is fine. could you double check in the console: so when you run the app, inspect the code through the browser, then head to the console, any errors printed? if not this is fine

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was no error.

switch (props.theme) {
case 'theme1':
return (
<TextWrapper>
Copy link
Contributor

@judeamos judeamos May 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works fine., but is there a way to refine this condition to be cleaner? so we're not duplicating the <Typography style={....}/> .... <Typography /> x2 for each case. Just an idea - this logic does not have to remain in the StyledRoleCard.js file, have a look at adding classes dynamically to html tags e.g <TextWrapper className={'${theme}'} etc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added classes for each theme dynamically.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you revert your changes. There's no need to push this into development/user-profile branch. As the role card is not meant to be shown here. This should only be in your local/task branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted the RoleCard Component from UserOnboardingModal.js.

Copy link
Contributor

@judeamos judeamos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reviewed your work. Can you revert the UserOnboardingModal.js back to the default version thats synced with development/user-profile branch. Once done let me know.

@rinagobo rinagobo merged commit 86f77de into development/user-profile May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants