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

refactor(ui): replace text with icons in dashboard light/dark toggle #17300

Merged
merged 1 commit into from
Mar 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions ui/src/dashboards/components/DashboardLightModeToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, {FC} from 'react'
import {connect} from 'react-redux'

// Components
import {SelectGroup} from '@influxdata/clockface'
import {SelectGroup, ButtonShape, Icon, IconFont} from '@influxdata/clockface'

// Actions
import {setTheme} from 'src/shared/actions/app'
Expand All @@ -25,22 +25,24 @@ type Props = OwnProps & StateProps & DispatchProps

const DashboardLightModeToggle: FC<Props> = ({theme, onSetTheme}) => {
return (
<SelectGroup testID="presentation-mode-toggle">
<SelectGroup testID="presentation-mode-toggle" shape={ButtonShape.Square}>
<SelectGroup.Option
onClick={() => onSetTheme('dark')}
value={false}
id="presentation-mode-toggle--dark"
active={theme === 'dark'}
titleText="Dark Mode"
>
Dark
<Icon glyph={IconFont.Moon} />
</SelectGroup.Option>
<SelectGroup.Option
onClick={() => onSetTheme('light')}
id="presentation-mode-toggle--light"
value={true}
active={theme === 'light'}
titleText="Light Mode"
>
Light
<Icon glyph={IconFont.Sun} />
</SelectGroup.Option>
</SelectGroup>
)
Expand Down