Skip to content

Commit

Permalink
style: fix logo in dark mode on login page
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Biraben-Renard <[email protected]>
  • Loading branch information
matalex412 and alexanderbira committed Aug 21, 2024
1 parent cd26bcb commit e4beda8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/auth/login/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { auth, signIn } from "@/auth"
import Link from "@/components/Link"
import ThemedLogo from "@/components/ThemedLogo"

import styles from "./page.module.scss"

import { Button, Flex, Separator, Text } from "@radix-ui/themes"
import { Heading } from "@react-email/components"
import { AuthError } from "next-auth"
import Image from "next/image"
import { redirect } from "next/navigation"
import React from "react"

Expand Down Expand Up @@ -36,7 +36,7 @@ const LoginPage = async () => {
return (
<Flex gap="6" direction="column">
<Flex className={styles.logosContainer}>
<Image src="/images/imperial-logo-blue.svg" alt="imperial logo in blue" width={0} height={0} />
<ThemedLogo />
</Flex>
<Flex pl="9" pr="9" direction="column" gap="5">
<Flex direction="column" justify="center" align="center">
Expand Down
2 changes: 1 addition & 1 deletion app/auth/login/partner/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const LoginPage = () => {
</TextField.Root>

<Button size="3" style={{ width: "100%" }}>
{isPending ? <Spinner /> : "Sign In With Magic Link"}
{isPending ? <Spinner /> : "Sign in with magic link"}
</Button>
</form>
</Flex>
Expand Down
19 changes: 19 additions & 0 deletions components/ThemedLogo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"use client"

import { useTheme } from "next-themes"
import Image from "next/image"

const ThemedLogo = () => {
const { resolvedTheme } = useTheme()
let src

if (resolvedTheme === "dark") {
src = "/images/imperial-logo.svg"
} else {
src = "/images/imperial-logo-blue.svg"
}

return <Image src={src} alt="imperial logo" width={0} height={0} />
}

export default ThemedLogo

0 comments on commit e4beda8

Please sign in to comment.