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

add ThemeToggleButton, tests and doc #482

Merged
merged 6 commits into from
Sep 17, 2024

Conversation

coskucinkilic
Copy link
Contributor

@coskucinkilic coskucinkilic commented Sep 17, 2024

Motivation

Add new ThemeToggleButton component

Changes

ThemeToggleButton component added to repo
Tests for ThemeToggleButton added to spec file
ThemeToggleButton is added to showcase
--icon-color variable added to IconDarkMode and IconLightMode
New --sidebar-icon variable has been added to themes

Screenshots

Screenshot 2024-09-17 at 14 16 49 Screenshot 2024-09-17 at 14 15 09

@coskucinkilic coskucinkilic marked this pull request as ready for review September 17, 2024 12:19
@coskucinkilic coskucinkilic requested review from a team as code owners September 17, 2024 12:19
Copy link
Member

@peterpeterparker peterpeterparker left a 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. How does it look in the gix-cmp showcase? If it needs adaptation, are you going to provide those in another PR? (It’s probably best to do it in two separate PRs indeed.)

src/lib/components/ThemeToggle.svelte Outdated Show resolved Hide resolved
src/lib/components/ThemeToggle.svelte Outdated Show resolved Hide resolved
src/lib/components/ThemeToggle.svelte Outdated Show resolved Hide resolved
@dskloetd
Copy link
Collaborator

Does this button work as a drop-in replacement of the toggle even if we don't move the component to a different place in the page?
If not, I think it would be better to introduce a new component instead of changing the existing one.

@peterpeterparker
Copy link
Member

drop-in replacement

Note that I left comments assuming it was a drop-in replacement (that the community dev using the lib should also adopt).
Agree on introducing a new component if it isn't.

@coskucinkilic
Copy link
Contributor Author

Waiting for an answer from Artem

@coskucinkilic
Copy link
Contributor Author

Artem told me this is a replacement, please provide feedback accordingly

@dskloetd
Copy link
Collaborator

Artem told me this is a replacement, please provide feedback accordingly

I'm confused by this. Can you show me how this looks in the account menu instead of the current theme switcher in the account menu?

@coskucinkilic
Copy link
Contributor Author

@dskloetd here you go:
Screenshot 2024-09-17 at 15 42 31

Copy link
Collaborator

@dskloetd dskloetd left a comment

Choose a reason for hiding this comment

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

Thanks!

@peterpeterparker
Copy link
Member

Look weird in the context menu but, that's a question above my pay grade.

Can you also share the screenshots regarding my earlier question as well?

@dskloetd
Copy link
Collaborator

dskloetd commented Sep 17, 2024

@peterpeterparker is talking about this: https://github.com/dfinity/gix-components?tab=readme-ov-file#documentation--showcase

If you npm run dev it shows a page where you can see all the components in action.

@coskucinkilic
Copy link
Contributor Author

@peterpeterparker
Screenshot 2024-09-17 at 16 03 12
Screenshot 2024-09-17 at 16 03 19
@dskloetd there are couple of updates after your approval, could you please take a quick look?

@peterpeterparker
Copy link
Member

Thanks. In the context menu it's fine as well?

Capture d’écran 2024-09-17 à 16 08 08

@coskucinkilic
Copy link
Contributor Author

After talking with Artem again, he said we will most probably don't use it but as people are aready using it outside of NNS let's keep both toggle and the button.

I will be moving some files around, will leave the context menu as is with ThemeToggle

Copy link
Member

@peterpeterparker peterpeterparker left a comment

Choose a reason for hiding this comment

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

Can you edit the description of the PR, I think it does not match anymore given that you are providing a new component.

src/lib/styles/themes/dark.scss Show resolved Hide resolved
@coskucinkilic coskucinkilic changed the title update theme toggle and tests add ThemeToggleButton, tests and doc Sep 17, 2024
Copy link
Member

@peterpeterparker peterpeterparker left a comment

Choose a reason for hiding this comment

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

LGTM, thx

@coskucinkilic coskucinkilic merged commit 9a16f6f into main Sep 17, 2024
8 checks passed
@coskucinkilic coskucinkilic deleted the NNS1-2965-update-theme-toggle branch September 17, 2024 15:08

## Showcase

<ThemeToggleButton />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not important at all, but I was wondering if it makes sense to put the switch and the button on the same show-case page so you can see them side by side and know the other one also exists if you look at one.

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense. I actually started writing a review comment when I approved the PR about referencing the components (adding links from one to the other), but ultimately did not provide the feedback as I felt I had already been picky enough.

@coskucinkilic WDYT?

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.

3 participants