Skip to content

Commit

Permalink
feat(components): ayu_mirage, ayu_light, nord, polar themes (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaNecron authored Aug 27, 2021
1 parent dfa0419 commit 7e8cda4
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 9 deletions.
16 changes: 14 additions & 2 deletions src/components/Theming.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,31 @@ import { CssBaseline } from '@material-ui/core';
import dark_blue from 'lib/themes/dark_blue';
import dark from 'lib/themes/dark';
import ayu_dark from 'lib/themes/ayu_dark';
import ayu_mirage from 'lib/themes/ayu_mirage';
import ayu_light from 'lib/themes/ayu_light';
import nord from 'lib/themes/nord';
import polar from 'lib/themes/polar';
import { useStoreSelector } from 'lib/redux/store';
import createTheme from 'lib/themes';

export const themes = {
'dark_blue': dark_blue,
'dark': dark,
'ayu_dark': ayu_dark
'ayu_dark': ayu_dark,
'ayu_mirage': ayu_mirage,
'ayu_light': ayu_light,
'nord': nord,
'polar': polar
};

export const friendlyThemeName = {
'dark_blue': 'Dark Blue',
'dark': 'Very Dark',
'ayu_dark': 'Ayu Dark'
'ayu_dark': 'Ayu Dark',
'ayu_mirage': 'Ayu Mirage',
'ayu_light': 'Ayu Light',
'nord': 'Nord',
'polar': 'Polar'
};

export default function ZiplineTheming({ Component, pageProps }) {
Expand Down
8 changes: 4 additions & 4 deletions src/lib/themes/ayu_dark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ export default createTheme({
type: 'dark',
primary: '#E6B450',
secondary: '#FFEE99',
error: '#FF3333',
error: '#F07178',
warning: '#F29668',
info: '#95E6CB',
border: '#0A0E14',
border: '#0D1016',
background: {
main: '#0D1016',
paper: '#0A0E14'
main: '#0A0E14',
paper: '#0D1016'
}
});
17 changes: 17 additions & 0 deletions src/lib/themes/ayu_light.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// https://github.com/AlphaNecron/
// https://github.com/ayu-theme/ayu-colors
import createTheme from '.';

export default createTheme({
type: 'light',
primary: '#FF9940',
secondary: '#E6BA7E',
error: '#F07171',
warning: '#ED9366',
info: '#95E6CB',
border: '#FFFFFF',
background: {
main: '#FAFAFA',
paper: '#FFFFFF'
}
});
17 changes: 17 additions & 0 deletions src/lib/themes/ayu_mirage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// https://github.com/AlphaNecron/
// https://github.com/ayu-theme/ayu-colors
import createTheme from '.';

export default createTheme({
type: 'dark',
primary: '#FFCC66',
secondary: '#FFD580',
error: '#F28779',
warning: '#F29E74',
info: '#95E6CB',
border: '#232834',
background: {
main: '#1F2430',
paper: '#232834'
}
});
17 changes: 17 additions & 0 deletions src/lib/themes/nord.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// https://github.com/AlphaNecron/
// https://github.com/arcticicestudio/nord
import createTheme from '.';

export default createTheme({
type: 'dark',
primary: '#81A1C1',
secondary: '#88C0D0',
error: '#BF616A',
warning: '#EBCB8B',
info: '#5E81AC',
border: '#3B4252',
background: {
main: '#2E3440',
paper: '#3B4252'
}
});
17 changes: 17 additions & 0 deletions src/lib/themes/polar.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// https://github.com/AlphaNecron/
// https://github.com/arcticicestudio/nord
import createTheme from '.';

export default createTheme({
type: 'light',
primary: '#81A1C1',
secondary: '#88C0D0',
error: '#BF616A',
warning: '#EBCB8B',
info: '#5E81AC',
border: '#E5E9F0',
background: {
main: '#D8DEE9',
paper: '#E5E9F0'
}
});
6 changes: 3 additions & 3 deletions src/pages/api/auth/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ async function handler(req: NextApiReq, res: NextApiRes) {
}
});

if (!user) return res.status(404).end(JSON.stringify({ message: 'not found' }));
if (!user) return res.status(404).end(JSON.stringify({ error: 'User not found' }));

const valid = await checkPassword(password, user.password);
if (!valid) return res.forbid('wrong password');
if (!valid) return res.forbid('Wrong password');

res.setCookie('user', user.id, { sameSite: true, maxAge: 10000000, path: '/' });

Expand All @@ -32,4 +32,4 @@ async function handler(req: NextApiReq, res: NextApiRes) {
return res.json({ success: true });
}

export default withZipline(handler);
export default withZipline(handler);

0 comments on commit 7e8cda4

Please sign in to comment.