Skip to content

Commit

Permalink
some theme colors and improve darkmode (electricitymaps#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonypls authored Nov 25, 2022
1 parent 22c59b9 commit c2831f9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions web/src/components/ToggleButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { ReactElement } from 'react';
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
import * as Tooltip from '@radix-ui/react-tooltip';
import { useTranslation } from '../translation/translation';
import { HiOutlineInformationCircle } from 'react-icons/hi2';

interface ToggleButtonProperties {
options: Array<{ value: string; translationKey: string }>;
Expand All @@ -22,7 +21,7 @@ export default function ToggleButton({
<div className="z-10 flex h-9 rounded-full bg-gray-100 px-[5px] py-1 drop-shadow dark:bg-gray-900">
<ToggleGroupPrimitive.Root
className={
' flex-start flex h-[26px] flex-grow flex-row items-center justify-between self-center rounded-full border bg-gray-100 shadow-inner dark:bg-gray-700'
' flex-start flex h-[26px] flex-grow flex-row items-center justify-between self-center rounded-full bg-gray-100 shadow-inner dark:bg-gray-700'
}
type="multiple"
aria-label="Font settings"
Expand Down
2 changes: 1 addition & 1 deletion web/src/features/panels/LeftPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function OuterPanel({ children }: { children: React.ReactNode }) {

return (
<aside
className={`absolute left-0 top-0 z-20 h-full w-full bg-zinc-50 shadow-xl transition-all duration-500 dark:bg-gray-800 md:flex md:w-[calc(14vw_+_16rem)] ${
className={`absolute left-0 top-0 z-20 h-full w-full bg-zinc-50 shadow-xl transition-all duration-500 dark:bg-gray-800 dark:[color-scheme:dark] md:flex md:w-[calc(14vw_+_16rem)] ${
!isOpen && '-translate-x-full'
}`}
>
Expand Down
6 changes: 2 additions & 4 deletions web/src/features/panels/ranking-panel/RankingPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import { getRankedState } from './getRankingPanelData';
import SearchBar from './SearchBar';
import ZoneList from './ZoneList';

interface RankingPanelProperties {}

export default function RankingPanel(properties: RankingPanelProperties): ReactElement {
export default function RankingPanel(): ReactElement {
const { __ } = useTranslation();
const getCo2colorScale = useCo2ColorScale();
const [timeAverage] = useAtom(timeAverageAtom);
Expand All @@ -22,7 +20,7 @@ export default function RankingPanel(properties: RankingPanelProperties): ReactE
setSearchTerm(lowerCase);
};

const { isLoading, isSuccess, isError, error, data } = useGetState(timeAverage);
const { isLoading, data } = useGetState(timeAverage);
const rankedList = getRankedState(data, getCo2colorScale, 'asc', selectedDatetime);
const filteredList = rankedList.filter((zone) => {
if (zone.countryName && zone.countryName.toLowerCase().includes(searchTerm)) {
Expand Down
2 changes: 1 addition & 1 deletion web/src/features/panels/ranking-panel/ZoneList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface ZoneRow {
function ZoneRow({ zoneId, color, ranking, countryName, zoneName }: ZoneRow) {
return (
<InternalLink
className="group my-1 flex h-9 w-full items-center overflow-hidden rounded bg-gray-100 pl-3 text-left hover:bg-gray-200"
className="group my-1 flex h-9 w-full items-center overflow-hidden rounded bg-gray-100 pl-3 text-left hover:bg-gray-200 dark:bg-gray-700"
key={ranking}
to={`/zone/${zoneId}`}
>
Expand Down
2 changes: 2 additions & 0 deletions web/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const config = {
},
colors: {
'brand-green': '#135836',
'brand-yellow': '#E9B73B',
'brand-brown': '#702214',
},
},
fontFamily: {
Expand Down

0 comments on commit c2831f9

Please sign in to comment.