grandma-collaboration / skyportal_grandma_dev

Little Git Repo to keep track of the work done by the A4 ESILV TEAM
2 stars 0 forks source link

Céline Liu/ Adrien Bonnefoy/ Adrien Bonnefon - Add colors in classification #23

Closed celiune closed 1 year ago

celiune commented 1 year ago

Hello @Theodlz 👋 I'll be working on the 2nd task given by Sarah which is add colors in classification. I'll start to work on it when I'll be done with the tutorial. Thank you for your time! 🚀

celiune commented 1 year ago

Hello @Theodlz @mcoughlin , With @Adiman007 @KodeurFou we've been working together on this task for weeks, but couldn't give you any update before because we didn't know where and what to search, so we tried to look for where to change the color of the classifications first before knowing that we need to change the background color of the classifications. Last week we've gotten Icare's github's code and we tried to adapt it on the ShowClassification.jsx file. However, we've gotten an error that we don't really understand, here are the images of the make log as well as the changes we've made on the ShowClassification.jsx file as attached documents . image image image image image image Thank you for your time in advance! :rocket:

mcoughlin commented 1 year ago

@celiune So we have examples kind of like this in the GcnTags.jsx (which doesn't look all that different from what you are trying). I would have simply copied in the below:

const useStyles = makeStyles(() => ({ BNS: { background: "#468847!important", }, NSBH: { background: "#b94a48!important", }, BBH: { background: "#333333!important", }, GRB: { background: "#f89406!important", }, AMON: { background: "#3a87ad!important", }, Terrestrial: { background: "#999999!important", }, }));

const styles = useStyles();

Changed the names for typical classifications and used the className={styles[tag]} trick in that code. Is that what you were trying?

Adiman007 commented 1 year ago

Yes that was what we did but we didn't do it well, since it broke the test webpage, we had a white screen or the troubleshooting page when we wanted to access the sources or default page. I think it was with the way we manage the application of the styles because the log said that we had an error with a page we didn't change, we will get our head around the problem and we will catch it (finger crossed) .