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

Label info link + update Tooltip theme setting #242

Merged
merged 2 commits into from
Apr 30, 2024
Merged

Conversation

quietbits
Copy link
Contributor

@quietbits quietbits commented Apr 30, 2024

Info text (in tooltip)
image

Info link (opens in new window)
image

@stellar-jenkins
Copy link

@stellar-jenkins
Copy link

Comment on lines +56 to +64
callback={(isOpen) => {
if (isOpen) {
const theme = document.body.getAttribute("data-sds-theme");

if (theme) {
setTheme(theme);
}
}
}}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using a callback is more accurate than using a listener.

@@ -60,22 +60,14 @@ export const ThemeSwitch = ({
if (isDarkMode) {
document.body.classList.remove(ThemeMode.LIGHT);
document.body.classList.add(ThemeMode.DARK);
document.body.setAttribute("data-sds-theme", ThemeMode.DARK);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Other components can check for this attribute to get the current theme.

@quietbits quietbits merged commit 74dc9c1 into sds-v3 Apr 30, 2024
2 checks passed
@quietbits quietbits deleted the v3-label-infolink branch April 30, 2024 17:19
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