Skip to content

Commit

Permalink
🔒️ Improved login
Browse files Browse the repository at this point in the history
  • Loading branch information
ThijmenGThN committed Dec 7, 2023
1 parent f653fd8 commit a617b96
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 120 deletions.
46 changes: 0 additions & 46 deletions app/[locale]/admin/OAuth.tsx

This file was deleted.

32 changes: 13 additions & 19 deletions app/[locale]/admin/login/page.tsx
Original file line number Diff line number Diff line change
@@ -1,43 +1,37 @@
"use client"

import Image from 'next/image'
import { useTranslations } from 'next-intl'

import { Link } from '@/helpers/navigation'

import OAuth from '../OAuth'
import Credentials from './Credentials'

import aLogo from '@/assets/logo.webp'

export default function Page() {
const t = useTranslations('auth')
const t = useTranslations()

return (
<div className="flex min-h-full flex-1 flex-col justify-center py-12 sm:px-6 lg:px-8">
<div className="sm:mx-auto sm:w-full sm:max-w-md">
<Link href="/">
<Image
className="mx-auto h-10 w-auto"
src={aLogo}
alt=""
/>
</Link>
<h2 className="mt-6 text-center text-2xl font-bold leading-9 tracking-tight text-gray-900">
{t('sign-in-to-your-account')}
</h2>
<div className="flex flex-col gap-y-3 text-center">
<div className='flex justify-center'>
<Link href="/">
<p className="text-2xl px-4 font-semibold hover:cursor-pointer">
{t('branding.title')}
</p>
</Link>
</div>
<p className="text-sm">
{t('branding.description')}
</p>
</div>

<div className="relative my-10 sm:mx-auto sm:w-full sm:max-w-[480px]">
<div className="bg-white px-6 py-12 shadow sm:rounded-lg sm:px-12">
<Credentials />

<OAuth />
</div>

<div className="absolute -bottom-10 left-5 text-center text-sm text-gray-500">
<Link href="/">
{t('return-to-wiki')}
{t('auth.return-to-wiki')}
</Link>
</div>
</div>
Expand Down
7 changes: 5 additions & 2 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import { useTranslations } from 'next-intl'

import { Link } from '@/helpers/navigation'

export default function Header() {
const t = useTranslations()

return (
<div className="flex flex-col gap-y-3 text-center">
<div className='flex justify-center'>
<Link href="/">
<p className="text-2xl px-4 font-semibold hover:cursor-pointer">
Wiki
{t('branding.title')}
</p>
</Link>
</div>
<p className="text-sm">
Maintained by Thijmen Heuvelink
{t('branding.description')}
</p>
</div>
)
Expand Down
14 changes: 3 additions & 11 deletions src/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
{
"next-leaflet": {
"an-optimized-tech-stack-for-efficiency": "An optimized tech stack for efficiency",
"report-an-issue": "Report an issue",
"dashboard": "Dashboard",
"contribute": "Contribute",
"back-to-homepage": "Back to homepage",
"sorry-we-could-not-find-the-page-you-are-looking-for": "Sorry, we could not find the page you are looking for",
"page-not-found": "Page not found",
"an-error-occurred": "An error occurred",
"sorry-something-unexpected-happened": "Sorry, something unexpected happened",
"try-again": "Try again"
"branding": {
"title": "Wiki",
"description": "Maintained by Thijmen Heuvelink"
},
"dashboard": {
"signed-in-as": "Signed in as",
Expand Down
43 changes: 1 addition & 42 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,48 +14,7 @@ module.exports = {
// then supply https://tailwindshades.com with your colors
// to generate the objects that are required below.

primary: {
DEFAULT: '#11999E',
50: '#76ECF0',
100: '#64E9EE',
200: '#3FE4EA',
300: '#1ADFE6',
400: '#15BDC3',
500: '#11999E',
600: '#0C686B',
700: '#063739',
800: '#010606',
900: '#000000',
950: '#000000'
},
secondary: {
DEFAULT: '#119E7F',
50: '#76F0D5',
100: '#64EED0',
200: '#3FEAC5',
300: '#1AE6B9',
400: '#15C39D',
500: '#119E7F',
600: '#0C6B56',
700: '#06392E',
800: '#010605',
900: '#000000',
950: '#000000'
},
accent: {
DEFAULT: '#092A2C',
50: '#28BBC4',
100: '#25ABB3',
200: '#1E8B92',
300: '#176B70',
400: '#104A4E',
500: '#092A2C',
600: '#000000',
700: '#000000',
800: '#000000',
900: '#000000',
950: '#000000'
}
primary: '#000'
}
}
}
Expand Down

0 comments on commit a617b96

Please sign in to comment.