-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restyle the UI for dark/light mode (#16)
* Numerous styling changes to bring things to more of a dark-mode compatible state. * Add dark/light mode toggle * Restyle the download button and bring it to the top of the UI * Get rid of a LOT of empty/unused space * Fix download to use a unique filename with zoom, lat, lng, and .parquet suffix. * Add a geolocate control. --------- Co-authored-by: Benjamin Clark <clarkben@meta.com>
- Loading branch information
Showing
15 changed files
with
193 additions
and
52 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { setTheme } from './themeUtils'; | ||
import PropTypes from 'prop-types'; | ||
|
||
export default function DarkModeToggle({ mode, setMode }) { | ||
|
||
const toggleDarkMode = () => { | ||
|
||
if (mode === 'theme-dark') { | ||
setTheme('theme-light', setMode); | ||
} else { | ||
setTheme('theme-dark', setMode); | ||
} | ||
}; | ||
|
||
return ( | ||
<div> | ||
<button id="toggle" className="toggle--checkbox" onClick={toggleDarkMode} readOnly> | ||
<img src={mode === 'theme-light' ? '/lightmode.svg' : '/darkmode.svg'} /> | ||
</button> | ||
</div> | ||
); | ||
} | ||
|
||
DarkModeToggle.propTypes = { | ||
mode: PropTypes.string.isRequired, | ||
setMode: PropTypes.func.isRequired | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
import overtureLogo from '/omf_logo_transparent.png'; | ||
import DownloadButton from './DownloadButton'; | ||
import OvertureWordmark from './OvertureWordmark'; | ||
import DarkModeToggle from './DarkModeToggle'; | ||
import PropTypes from 'prop-types'; | ||
|
||
export default function Header() { | ||
export default function Header({ mode, setMode }) { | ||
return ( | ||
<> | ||
<div className="header"> | ||
<a href="https://overturemaps.org" target="_blank"> | ||
<img | ||
src={overtureLogo} | ||
className="logo overture" | ||
alt="Overture Maps logo" | ||
/> | ||
</a> | ||
<div>Overture Maps Explorer</div> | ||
<div className={`header ${mode}` }> | ||
<OvertureWordmark></OvertureWordmark> | ||
<DarkModeToggle mode={mode} setMode={setMode}></DarkModeToggle> | ||
<DownloadButton></DownloadButton> | ||
</div> | ||
</> | ||
); | ||
} | ||
|
||
Header.propTypes = { | ||
mode: PropTypes.string.isRequired, | ||
setMode: PropTypes.func.isRequired | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import overtureLogo from '/omf_logo_transparent.png'; | ||
|
||
export default function OvertureWordmark() { | ||
return ( | ||
<> | ||
<div className='wordmark'> | ||
<a href="https://overturemaps.org" target="_blank"> | ||
<img | ||
src={overtureLogo} | ||
className="logo overture" | ||
alt="Overture Maps logo" | ||
/> | ||
</a> | ||
<div>Overture Maps</div> | ||
</div> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.