Skip to content

Commit

Permalink
#226: move menu to top
Browse files Browse the repository at this point in the history
  • Loading branch information
braddf committed Sep 23, 2022
1 parent 0376ac4 commit aeca398
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"presets": ["next/babel"]
},
"rules": {
"@next/next/no-img-element": "off"
"@next/next/no-img-element": "off",
"prettier/prettier": "error"
}
}
2 changes: 2 additions & 0 deletions apps/nowcasting-app/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
node_modules/*
node_modules
.next/*
**/data/*
**/data/**/*
2 changes: 1 addition & 1 deletion apps/nowcasting-app/components/button-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const ButtonGroup = ({ rightString }: IButtonGroup) => {
>
DELTA
</button>
<div className="absolute left-0 top-0 items-center px-3 py-2 mx-1 ml-px text-lg font-extrabold text-black bg-white">
<div className="absolute left-0 top-0 items-center px-3 py-2 mx-1 ml-px text-lg font-extrabold text-black bg-white">
{rightString}
</div>
</span>
Expand Down
2 changes: 1 addition & 1 deletion apps/nowcasting-app/components/charts/pv-remix-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const PvRemixChart: FC<{ date?: string }> = () => {
setSelectedISOTime(time + ":00.000Z");
};
return (
<div className="flex flex-col flex-1 mb-12">
<div className="flex flex-col flex-1 mt-12 mb-1">
<div className="flex-grow mb-7">
<ForecastHeader
pvForecastData={nationalForecastData}
Expand Down
4 changes: 2 additions & 2 deletions apps/nowcasting-app/components/charts/remix-line.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ const RemixLine: React.FC<RemixLineProps> = ({
style={{ color: toolTipColors[name] }}
>
<div className={`flex justify-between`}>
<div className={`font-extrabold`}>{toolTiplabels[name]}:{" "}</div>
<div className={`font-extrabold`}>{toolTiplabels[name]}: </div>
<div className="font-serif font-extrabold text-sm ml-7">
{" "}
{prettyPrintYNumberWithCommas(value as string)}{" "}
Expand All @@ -219,7 +219,7 @@ const RemixLine: React.FC<RemixLineProps> = ({
<li className={`flex justify-between pt-4 text-sm text-white font-serif`}>
<div>
{formatISODateStringHumanNumbersOnly(data?.formatedDate + ":00+00:00")}{" "}
</div>
</div>
<div>MW</div>
</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion apps/nowcasting-app/components/side-layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const SideLayout: React.FC<SideLayoutProps> = ({ children, className }) => {
(className || "")
}
>
<div className="relative h-full flex flex-col overflow-y-scroll">{children}</div>
<SideFooter />
<div className="relative h-full flex flex-col overflow-y-scroll">{children}</div>
</div>
<div className="absolute bottom-16 -right-5 h-10 mb-[3px]">
<ExpandButton isOpen={isOpen} onClick={() => setIsOpen((o) => !o)} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const SideFooter: React.FC<SideFooterProps> = ({}) => {
const [forecastCreationTime] = useGlobalState("forecastCreationTime");

return (
<footer className="text-white text-right px-2 bg-black flex absolute bottom-0 w-full p-1 text-sm ">
<footer className="text-white text-right px-2 bg-black flex absolute top-0 w-full p-1 text-sm ">
<div className="p-1 items-center inline-flex">
<a
className="flex h-6 w-auto mr-2"
Expand Down
13 changes: 6 additions & 7 deletions apps/nowcasting-app/components/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,19 @@ export const convertISODateStringToLondonTime = (date: string) => {
return date_london_time_str;
};


export const formatISODateStringHuman = (date: string) => {
// Change date to nice human readable format.
// Note that this converts the string to Europe London Time
// timezone and seconds are removed

const d = new Date(date);

const date_london = d.toLocaleString("en-GB", {
weekday: 'long',
day: 'numeric',
month: 'long',
year: 'numeric',
timeZone: 'Europe/London'
weekday: "long",
day: "numeric",
month: "long",
year: "numeric",
timeZone: "Europe/London"
});
return `${date_london}`;
};
Expand Down
4 changes: 2 additions & 2 deletions apps/nowcasting-app/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const defaultTheme = require("tailwindcss/defaultTheme")
const defaultTheme = require("tailwindcss/defaultTheme");

module.exports = {
content: ["./pages/**/*.{js,ts,jsx,tsx}", "./components/**/*.{js,ts,jsx,tsx}"],
Expand All @@ -17,7 +17,7 @@ module.exports = {
fontFamily: {
sans: ["Inter", ...defaultTheme.fontFamily.sans],
mono: ["ui-monospace", ...defaultTheme.fontFamily.mono],
serif: ["Source Code Pro", ...defaultTheme.fontFamily.serif],
serif: ["Source Code Pro", ...defaultTheme.fontFamily.serif]
},
colors: {
amber: {
Expand Down

0 comments on commit aeca398

Please sign in to comment.