-
Notifications
You must be signed in to change notification settings - Fork 29
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
Updating Changes acc. to #788 #1787
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
@@ -8,7 +8,7 @@ const theme = { | |||
}, | |||
colors: { | |||
BLUE: '#3A7CA5', | |||
BLUE_100: '#75A3C0', | |||
BLUE_100: '#7A87C7', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes to BLUE_100, YELLOW_100, ORANGE_100, SUCCESS_100 and this file as a whole need to be reviewed by design team before merging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Mohammed.
@Nouri-Anouar can you take a look at the changes here, or let us know if there is someone else who can help? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dbradham it appears this file is outdated and does not align with our design system.
@Enjoy2Live can we have colors from the design tokens here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Enjoy2Live @Nouri-Anouar this seems out of scope for Hindu's change. Neither the old color, nor the color she is updating to are in the current design system you shared here.
CC: @JulieMass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dbradham true and for that I'd recommend your team to use tailwind for cases like these because anything related to styled components is considered outdated/deprecated, for the now I think you should use the token Blue-blue-100
as tailwind className.
Example: bg-Blue-blue-100
applies #75A3C0 as background color
@Nouri-Anouar looking at tokens studio I'm still seeing Blue-blue-100
color token while it's not showing in the color pallete you linked, make sure to update either to match the other so we avoid confusions like these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to give a bit of context for everyone, the color names have been updated as follows:
- Light Blue -> Uranus.
- Blue -> Neptune.
- Yellow -> Saturn.
- Orange -> Jupiter.
Additionally, there are additional values compared to this file ranging from 50 to 900. For dark mode, we're utilizing color values of 300, while 500 for light mode (ex: Color: Saturn 500, Mode: Light).
I believe we should use their respective TailwindCSS classes instead @Enjoy2Live?
I opened a PR for this fix #1791
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the PR Anouar, this makes a ton of sense now.
fix(revert changes for tailwind on idea card tag)
if (status === 'submitted') { | ||
setTag('submitted'); | ||
setTagColor(theme.colors.LIGHT_BLUE_100); | ||
} else if (status == 'applying') { | ||
setTagColor('--light-blue-lightblue-100'); | ||
} else if (status === 'applying') { | ||
setTag('in-review'); | ||
setTagColor(theme.colors.YELLOW_100); | ||
} else if (status == 'approved') { | ||
setTagColor('--yellow-yellow-100'); | ||
} else if (status === 'approved') { | ||
setTag('approved'); | ||
setTagColor(theme.colors.SUCCESS_100); | ||
} else if (status == 'archived') { | ||
setTagColor('--success-success-100'); | ||
} else if (status === 'archived') { | ||
setTag('archived'); | ||
setTagColor(theme.colors.BLUE_100); | ||
setTagColor('--blue-blue-100'); | ||
} else { | ||
setTag('workshopping'); | ||
setTagColor(theme.colors.ORANGE_100); | ||
setTagColor('--orange-orange-100'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a more maintainable and readable way to handle this is by using a key value pair of [status]: 'tailwind-class'
const tagColor = {
applying: 'bg-yellow-yellow-100'
.
.
.
}
return <myDiv className={tagColor[status]} />
then you won't need most of this logic and useEffect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @Enjoy2Live, I tried this approach, and I can't seem to access Tailwind CSS colors. Perhaps there is something missing, for not being able to apply Tailwind CSS classes correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @Hindu-Priya , you said you tried this approach but I'm not seeing the commit for your try.
can you please make a commit with my suggestion and push it so I can take a look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @Enjoy2Live, I just committed my attempt based on your suggestion. Please take a look when you get a chance.
I just merged the PR that should fix the colors to master, let me know if you face issues going forward |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty much approved but please go through my requested changes and fix them before merging.
@dbradham it seems like there's duplicated work here, we've had a shared tag component already implemented some time ago. it's going to save you lots of time once you use as changes there are reflected on your app and the rest of the apps.
apps/app/pages/_app.js
Outdated
@@ -1,6 +1,10 @@ | |||
import Head from 'next/head'; | |||
import '../../../packages/tailwind-constructor/output/core.css'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not needed as we're already importing tailwind.css in this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Earlier, I encountered an error indicating that CSS should be included globally. This occurred when I didn't use the Tailwind class "bg-LightBlue-lightblue-100" in this manner. In the latest commit, I removed the comments and made minor changes. Thanks!
@@ -1,31 +1,43 @@ | |||
import React, { useState } from 'react'; | |||
import theme from '@devlaunchers/components/styles/theme'; | |||
// import theme from '@devlaunchers/components/styles/theme'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove this instead of commenting
const tagColor = { | ||
submitted: 'bg-light-blue-lightblue-100', | ||
'in-review': 'bg-yellow-yellow-100', | ||
approved: 'bg-success-success-100', | ||
archieved: 'bg-blue-blue-100', | ||
workshopping: 'bg-orange-orange-100', | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these should be typed like this:
const tagColor = {
submitted: 'bg-LightBlue-lightblue-100',
'in-review': 'bg-Yellow-yellow-100',
approved: 'bg-Success-success-100',
archieved: 'bg-Blue-blue-100',
workshopping: 'bg-Orange-orange-100',
};
I fixed it in the last commit so you just need to pull
// } | ||
// }, [status]); | ||
|
||
return <StatuBox backgroundColor={tagColor[status]}> {status} </StatuBox>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should substitute backgroundColor prop with className because that's how tailwind works.
I fixed it in the last commit so you just need to pull
Hi there, I made all the necessary changes. Please look at the latest commit, when you get a chance. |
CC: @Enjoy2Live |
const [tag, setTag] = useState(''); | ||
// const [tagColor, setTagColor] = useState(''); | ||
if (status == 'applying') { | ||
status = 'in-review'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Hindu-Priya
props are immuatable so you can't assign different values to it if I'm not mistaken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other than that this PR is approved by me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Enjoy2Live that may be true in TypeScript, but I don't believe the same applies to JavaScript. Source: https://www.reddit.com/r/reactjs/comments/14howx9/why_im_able_to_change_props_value_if_props_are/?rdt=59264
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not a typescript or javascript thing, it's a react thing.
in react you can't change props this way as props are immutable
Don’t try to “change props”. When you need to respond to the user input (like changing the selected color), you will need to “set state”, which you can learn about in State: A Component’s Memory.
Source: https://react.dev/learn/passing-props-to-a-component#how-props-change-over-time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Enjoy2Live, @dbradham
I made a new commit, ensuring props immutability in the component. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it's at a much better state but let's make sure we remove this file at some point and import the global tag component to ensure consistency and smaller codebase.
CC @dbradham
Approved!
P.S. this PR is going to master and I'm not sure if it's intended
Hi there, I have updated colors acc. to the top ones in the new design system styleguide tags, as per the dark mode theme.