WIP: Creating component switcher #158

Closed
r2shuai wants to merge 2 commits from richardshuai/component-switcher into main
Collaborator

This is specifically for Issue #142.

Work in progress and please check if this is what we want for the component switcher. Thanks!

This is specifically for Issue #142. Work in progress and please check if this is what we want for the component switcher. Thanks!
r2shuai added 1 commit 2 months ago
a4a012a7a6 Creating component switcher
r2shuai requested review from e26chiu 2 months ago
snedadah reviewed 2 months ago
snedadah left a comment
Owner

Nice work!
Yep, this is what we are looking for. I reccomend you add it to the top of the SamplePage so you can view and test it as you develop. (Copying some of those graphs as well)

https://git.csclub.uwaterloo.ca/www/cs-2022-class-profile/src/branch/main/pages/samplePage.tsx

The hard part is going to be having to style it. Let me know if you need any help or run into issues!

Nice work! Yep, this is what we are looking for. I reccomend you add it to the top of the SamplePage so you can view and test it as you develop. (Copying some of those graphs as well) https://git.csclub.uwaterloo.ca/www/cs-2022-class-profile/src/branch/main/pages/samplePage.tsx The hard part is going to be having to style it. Let me know if you need any help or run into issues!
r2shuai added 1 commit 2 months ago
408896098e component switcher and attempt to style
r2shuai requested review from snedadah 2 months ago
Poster
Collaborator

The current issue is: if two graphs are of different types (for example, pie and line), they might have different height.

The solutions are: 1. wrap the graph around a container that has a set height, but might disrupt its aspect ratio; 2. keep the way it is but the position might shift.

Also, the lint failed because I am currently not using an assigned state. We can change this later if everything else is complete.

Let me know if I need to change anything. Thanks for reviewing :)

The current issue is: if two graphs are of different types (for example, pie and line), they might have different height. The solutions are: 1. wrap the graph around a container that has a set height, but might disrupt its aspect ratio; 2. keep the way it is but the position might shift. Also, the lint failed because I am currently not using an assigned state. We can change this later if everything else is complete. Let me know if I need to change anything. Thanks for reviewing :)
e26chiu requested changes 2 months ago
e26chiu left a comment
Collaborator

Hey @r2shuai ! Thanks for working on this issue, it's definitely more complex since we don't have the design for this component! In our case (or at least, in this term), the type of the graph shouldn't change (it should be the same for all terms! Have we considered trying to put the buttons above instead? How would that look?
Otherwise, here are the comments and questions I have for now! Good work so far!

Hey @r2shuai ! Thanks for working on this issue, it's definitely more complex since we don't have the design for this component! In our case (or at least, in this term), the type of the graph shouldn't change (it should be the same for all terms! Have we considered trying to put the buttons above instead? How would that look? Otherwise, here are the comments and questions I have for now! Good work so far!
.btn {
--button-color: #E55F98;
--border-color: #FEA0C8;
Collaborator

Just a question, where did you choose these colours from? I think we should aim to reuse colours defined in the _app.css file as much as possible instead of definining new colours. It's also better if you define the variable names in that file so that it will be easier to change these values later on (since they are all mostly in that file).

Just a question, where did you choose these colours from? I think we should aim to reuse colours defined in the `_app.css` file as much as possible instead of definining new colours. It's also better if you define the variable names in that file so that it will be easier to change these values later on (since they are all mostly in that file).
Poster
Collaborator

These colors are taken directly from _app.css. I believe they are the primary and secondary accent colour. Let me know if I need to change them :)

These colors are taken directly from `_app.css`. I believe they are the primary and secondary accent colour. Let me know if I need to change them :)
--button-color: #CA634D;
--border-color: #FFBC9F;
background-color: var(--button-color);
Collaborator

There should be perhaps a cursor: pointer property to make the button seem clickable?

There should be perhaps a `cursor: pointer` property to make the button seem clickable?
buttonList,
graphList,
}: ComponentSwitcherProps) {
const [selectedButton, setSelectedButton] = useState("1A");
Collaborator

Instead of hardcoding this value, we could perhaps use buttonList[0]?

Instead of hardcoding this value, we could perhaps use `buttonList[0]`?
Poster
Collaborator

Ok I will change that!

Ok I will change that!
r2shuai marked this conversation as resolved
Poster
Collaborator

Hey @r2shuai ! Thanks for working on this issue, it's definitely more complex since we don't have the design for this component! In our case (or at least, in this term), the type of the graph shouldn't change (it should be the same for all terms! Have we considered trying to put the buttons above instead? How would that look?
Otherwise, here are the comments and questions I have for now! Good work so far!

Hey @e26chiu I tried to move the buttons to the top, but I think it looks better in the bottom in general (especially when there're a lot of them). You can try to see which one looks better and let me know if it needs to be changed!

> Hey @r2shuai ! Thanks for working on this issue, it's definitely more complex since we don't have the design for this component! In our case (or at least, in this term), the type of the graph shouldn't change (it should be the same for all terms! Have we considered trying to put the buttons above instead? How would that look? > Otherwise, here are the comments and questions I have for now! Good work so far! Hey @e26chiu I tried to move the buttons to the top, but I think it looks better in the bottom in general (especially when there're a lot of them). You can try to see which one looks better and let me know if it needs to be changed!
r2shuai closed this pull request 2 months ago
r2shuai reopened this pull request 2 months ago
r2shuai closed this pull request 2 months ago

Reviewers

snedadah was requested for review 2 months ago
e26chiu requested changes 2 months ago
Some checks failed
continuous-integration/drone/push Build is failing
Required
Details
This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: www/cs-2022-class-profile#158
Loading…
There is no content yet.