Added import sorting to prettier config
continuous-integration/drone/push Build is passing Details

main
Guus van Meerveld 2 years ago
parent 2b4b0d0a39
commit 53f63981c6
Signed by: Guusvanmeerveld
GPG Key ID: 2BA7D7912771966E

@ -1,9 +1,8 @@
import Link from "next/link"; import Link from "next/link";
import { format as formatTimeAgo } from "timeago.js";
import { FC } from "react";
import z from "zod"; import z from "zod";
import { format as formatTimeAgo } from "timeago.js"; import { FC } from "react";
import { RepositoryResponse } from "@models/git/responses"; import { RepositoryResponse } from "@models/git/responses";

@ -1,15 +1,14 @@
import z from "zod"; import Link from "next/link";
import { FC } from "react";
import { format as formatTimeAgo } from "timeago.js"; import { format as formatTimeAgo } from "timeago.js";
import z from "zod";
import Link from "next/link"; import styles from "./repositories.module.scss";
import multipleClassNames from "@utils/multipleClassNames"; import { FC } from "react";
import { RepositoryResponse } from "@models/git/responses"; import { RepositoryResponse } from "@models/git/responses";
import styles from "./repositories.module.scss"; import multipleClassNames from "@utils/multipleClassNames";
const FeaturedRepositories: FC<{ const FeaturedRepositories: FC<{
repositories: z.infer<typeof RepositoryResponse>[]; repositories: z.infer<typeof RepositoryResponse>[];

@ -1,12 +1,12 @@
import { FC } from "react";
import Link from "next/link"; import Link from "next/link";
import multipleClassNames from "@utils/multipleClassNames";
import { giteaServerUrl, giteaUsername } from "@utils/config";
import styles from "./footer.module.scss"; import styles from "./footer.module.scss";
import { FC } from "react";
import { giteaServerUrl, giteaUsername } from "@utils/config";
import multipleClassNames from "@utils/multipleClassNames";
const Footer: FC = () => { const Footer: FC = () => {
return ( return (
<footer className={multipleClassNames("container", styles.main)}> <footer className={multipleClassNames("container", styles.main)}>

@ -1,14 +1,14 @@
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import axios from "axios";
import { FC, FormEvent, useCallback, useState } from "react"; import { FC, FormEvent, useCallback, useState } from "react";
import axios from "axios";
import { LoginCredentials } from "@models/login"; import { LoginCredentials } from "@models/login";
import { Response } from "@models/response"; import { Response } from "@models/response";
import { parseAxiosError, parseAxiosResponse } from "@utils/fetch";
import { parseUserInputError } from "@utils/errors"; import { parseUserInputError } from "@utils/errors";
import { parseAxiosError, parseAxiosResponse } from "@utils/fetch";
const LoginForm: FC = () => { const LoginForm: FC = () => {
const [username, setUsername] = useState(""); const [username, setUsername] = useState("");
@ -87,7 +87,7 @@ const LoginForm: FC = () => {
<i className="form-icon" /> Remember me <i className="form-icon" /> Remember me
</label> </label>
{error !== null && ( {error !== null && (
<div className="toast toast-error"> <div className="toast toast-error mb-2">
<button <button
className="btn btn-clear float-right" className="btn btn-clear float-right"
onClick={() => setError(null)} onClick={() => setError(null)}

@ -1,14 +1,14 @@
import { FC } from "react";
import Link from "next/link"; import Link from "next/link";
import styles from "./post.module.scss";
import { FC } from "react";
import { Post, User } from "@prisma/client"; import { Post, User } from "@prisma/client";
import multipleClassNames from "@utils/multipleClassNames"; import multipleClassNames from "@utils/multipleClassNames";
import styles from "./post.module.scss"; const PostsPage: FC<{
const Post: FC<{
post: Post & { post: Post & {
author: User; author: User;
}; };
@ -51,4 +51,4 @@ const Post: FC<{
); );
}; };
export default Post; export default PostsPage;

@ -1,14 +1,14 @@
import axios from "axios"; import { useRouter } from "next/router";
import { FC, FormEvent, useCallback, useState } from "react"; import { FC, FormEvent, useCallback, useState } from "react";
import { useRouter } from "next/router"; import axios from "axios";
import { SignupCredentials } from "@models/signup";
import { Response } from "@models/response"; import { Response } from "@models/response";
import { SignupCredentials } from "@models/signup";
import { parseAxiosError, parseAxiosResponse } from "@utils/fetch";
import { parseUserInputError } from "@utils/errors"; import { parseUserInputError } from "@utils/errors";
import { parseAxiosError, parseAxiosResponse } from "@utils/fetch";
const SignupForm: FC = () => { const SignupForm: FC = () => {
const [email, setEmail] = useState(""); const [email, setEmail] = useState("");

@ -1,9 +1,9 @@
import { FC, useEffect, useState } from "react";
import { useTheme } from "next-themes"; import { useTheme } from "next-themes";
import styles from "./themeChanger.module.scss"; import styles from "./themeChanger.module.scss";
import { FC, useEffect, useState } from "react";
const ThemeChanger: FC = () => { const ThemeChanger: FC = () => {
const [mounted, setMounted] = useState(false); const [mounted, setMounted] = useState(false);
const { theme, setTheme } = useTheme(); const { theme, setTheme } = useTheme();

@ -1,14 +1,15 @@
import { FC } from "react"; import Image from "next/image";
import z from "zod"; import z from "zod";
import Image from "next/image"; import styles from "./user.module.scss";
import { FC } from "react";
import { UserResponse } from "@models/git/responses"; import { UserResponse } from "@models/git/responses";
import { giteaServerUrl } from "@utils/config"; import { giteaServerUrl } from "@utils/config";
import multipleClassNames from "@utils/multipleClassNames"; import multipleClassNames from "@utils/multipleClassNames";
import styles from "./user.module.scss";
const User: FC<{ isAvailable: boolean; user: z.infer<typeof UserResponse> }> = const User: FC<{ isAvailable: boolean; user: z.infer<typeof UserResponse> }> =
({ isAvailable, user }) => { ({ isAvailable, user }) => {
return ( return (

@ -1,6 +1,6 @@
$margin: 1rem; $margin: 1rem;
.main { .main {
margin-top: $margin; margin-top: $margin;
margin-bottom: $margin; margin-bottom: $margin;
} }

@ -1,7 +1,7 @@
.body { .body {
padding: 1rem; padding: 1rem;
} }
.info { .info {
text-align: right; text-align: right;
} }

@ -1,7 +1,7 @@
.card { .card {
border: 0; border: 0;
} }
.main { .main {
margin-bottom: 3rem; margin-bottom: 3rem;
} }

@ -1,7 +1,7 @@
.main { .main {
position: absolute; position: absolute;
top: 1rem; top: 1rem;
right: 1rem; right: 1rem;
cursor: pointer; cursor: pointer;
} }

@ -1,18 +1,17 @@
.main { .main {
padding-top: 10rem; padding-top: 10rem;
margin-bottom: 2rem; margin-bottom: 2rem;
} }
.avatar { .avatar {
border-radius: 5px; border-radius: 5px;
} }
.avatarContainer { .avatarContainer {
margin-right: 2rem; margin-right: 2rem;
} }
.avatarCol { .avatarCol {
display: flex; display: flex;
justify-content: right; justify-content: right;
} }

@ -1,8 +1,8 @@
.main { .main {
height: 100vh; height: 100vh;
margin-bottom: 1rem; margin-bottom: 1rem;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }

@ -1,11 +1,11 @@
import { NextPage } from "next"; import { NextPage } from "next";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import Layout from "@components/Layout"; import styles from "./404.module.scss";
import multipleClassNames from "@utils/multipleClassNames"; import multipleClassNames from "@utils/multipleClassNames";
import styles from "./404.module.scss"; import Layout from "@components/Layout";
const NotFound: NextPage = () => { const NotFound: NextPage = () => {
const router = useRouter(); const router = useRouter();

@ -1,14 +1,12 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import "@styles/globals.scss";
import SEO from "../next-seo.config";
import { DefaultSeo } from "next-seo"; import { DefaultSeo } from "next-seo";
import { ThemeProvider } from "next-themes"; import { ThemeProvider } from "next-themes";
import type { AppProps } from "next/app"; import type { AppProps } from "next/app";
import SEO from "../next-seo.config";
import "@styles/globals.scss";
const queryClient = new QueryClient(); const queryClient = new QueryClient();
const App = ({ Component, pageProps }: AppProps): JSX.Element => ( const App = ({ Component, pageProps }: AppProps): JSX.Element => (

@ -1,3 +1,3 @@
.body { .body {
padding: 10rem 0; padding: 10rem 0;
} }

@ -1,14 +1,14 @@
import { NextPage } from "next"; import { NextPage } from "next";
import { NextSeo } from "next-seo"; import { NextSeo } from "next-seo";
import { Post, User } from "@prisma/client"; import styles from "./admin.module.scss";
import Layout from "@components/Layout"; import { Post, User } from "@prisma/client";
import { withSessionSsr } from "@utils/session";
import prisma from "@utils/prisma"; import prisma from "@utils/prisma";
import { withSessionSsr } from "@utils/session";
import styles from "./admin.module.scss"; import Layout from "@components/Layout";
const AdminPage: NextPage<{ const AdminPage: NextPage<{
user: User; user: User;

@ -1,11 +1,11 @@
import { NextApiHandler } from "next"; import { NextApiHandler } from "next";
import { Post } from "@models/post";
import { Response } from "@models/response";
import { methodNotAllowed, unauthorized } from "@utils/errors"; import { methodNotAllowed, unauthorized } from "@utils/errors";
import { withIronSession } from "@utils/session";
import prisma from "@utils/prisma"; import prisma from "@utils/prisma";
import { withIronSession } from "@utils/session";
import { Response } from "@models/response";
import { Post } from "@models/post";
const handle: NextApiHandler<Response> = async (req, res) => { const handle: NextApiHandler<Response> = async (req, res) => {
if (req.method?.toUpperCase() != "POST") { if (req.method?.toUpperCase() != "POST") {

@ -4,9 +4,9 @@ import { NextApiHandler } from "next";
import { LoginCredentials } from "@models/login"; import { LoginCredentials } from "@models/login";
import { Response } from "@models/response"; import { Response } from "@models/response";
import { withIronSession } from "@utils/session";
import { methodNotAllowed, unauthorized } from "@utils/errors"; import { methodNotAllowed, unauthorized } from "@utils/errors";
import prisma from "@utils/prisma"; import prisma from "@utils/prisma";
import { withIronSession } from "@utils/session";
const handle: NextApiHandler<Response> = async (req, res) => { const handle: NextApiHandler<Response> = async (req, res) => {
if (req.method?.toUpperCase() !== "POST") { if (req.method?.toUpperCase() !== "POST") {

@ -1,9 +1,10 @@
import { NextApiHandler } from "next"; import { NextApiHandler } from "next";
import { withIronSession } from "@utils/session";
import { methodNotAllowed, unauthorized } from "@utils/errors";
import { Response } from "@models/response"; import { Response } from "@models/response";
import { methodNotAllowed, unauthorized } from "@utils/errors";
import { withIronSession } from "@utils/session";
const handle: NextApiHandler<Response> = (req, res) => { const handle: NextApiHandler<Response> = (req, res) => {
if (req.method?.toUpperCase() != "GET") { if (req.method?.toUpperCase() != "GET") {
res.status(405).json(methodNotAllowed); res.status(405).json(methodNotAllowed);

@ -1,7 +1,7 @@
import { Response } from "@models/response";
import { NextApiHandler } from "next"; import { NextApiHandler } from "next";
import { Response } from "@models/response";
import { registrationIsEnabled } from "@utils/config"; import { registrationIsEnabled } from "@utils/config";
import { methodNotAllowed } from "@utils/errors"; import { methodNotAllowed } from "@utils/errors";

@ -1,15 +1,13 @@
import bcrypt from "bcrypt"; import bcrypt from "bcrypt";
import { NextApiHandler } from "next"; import { NextApiHandler } from "next";
import prisma from "@utils/prisma";
import { SignupCredentials } from "@models/signup";
import { Response } from "@models/response"; import { Response } from "@models/response";
import { SignupCredentials } from "@models/signup";
import { withIronSession } from "@utils/session";
import { methodNotAllowed } from "@utils/errors";
import { registrationIsEnabled, saltRoundsForPassword } from "@utils/config"; import { registrationIsEnabled, saltRoundsForPassword } from "@utils/config";
import { methodNotAllowed } from "@utils/errors";
import prisma from "@utils/prisma";
import { withIronSession } from "@utils/session";
const handle: NextApiHandler<Response> = async (req, res) => { const handle: NextApiHandler<Response> = async (req, res) => {
if (!registrationIsEnabled) { if (!registrationIsEnabled) {

@ -1,3 +1,3 @@
.body { .body {
padding: 10rem 0; padding: 10rem 0;
} }

@ -1,14 +1,14 @@
import { NextSeo } from "next-seo";
import { GetStaticPaths, GetStaticProps, NextPage } from "next"; import { GetStaticPaths, GetStaticProps, NextPage } from "next";
import { NextSeo } from "next-seo";
import { Post, User } from "@prisma/client"; import styles from "./[id].module.scss";
import Layout from "@components/Layout"; import { Post, User } from "@prisma/client";
import Tags from "@components/Tags";
import prisma from "@utils/prisma"; import prisma from "@utils/prisma";
import styles from "./[id].module.scss"; import Layout from "@components/Layout";
import Tags from "@components/Tags";
const PostPage: NextPage<{ const PostPage: NextPage<{
post: Post & { post: Post & {

@ -1,10 +1,9 @@
.body { .body {
padding: 10rem 1rem;
padding: 10rem 1rem; @media (max-width: 840px) {
padding: 2rem 1rem;
}
@media (max-width: 840px) { min-height: 100vh;
padding: 2rem 1rem; }
}
min-height: 100vh;
}

@ -1,16 +1,15 @@
import { GetStaticProps, NextPage } from "next"; import { GetStaticProps, NextPage } from "next";
import { NextSeo } from "next-seo"; import { NextSeo } from "next-seo";
import { Post, User } from "@prisma/client"; import styles from "./blog.module.scss";
import Layout from "@components/Layout"; import { Post, User } from "@prisma/client";
import prisma from "@utils/prisma"; import prisma from "@utils/prisma";
import Layout from "@components/Layout";
import PostComponent from "@components/Post"; import PostComponent from "@components/Post";
import styles from "./blog.module.scss";
const Blog: NextPage<{ const Blog: NextPage<{
posts: (Post & { posts: (Post & {
author: User; author: User;

@ -1,4 +1,4 @@
.body { .body {
height: 100vh; height: 100vh;
padding: 10rem 0; padding: 10rem 0;
} }

@ -1,23 +1,23 @@
import axios from "axios";
import { FormEvent, useCallback, useState } from "react";
import { NextPage } from "next"; import { NextPage } from "next";
import { NextSeo } from "next-seo"; import { NextSeo } from "next-seo";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { User } from "@prisma/client"; import styles from "./new.module.scss";
import Layout from "@components/Layout"; import { FormEvent, useCallback, useState } from "react";
import { withSessionSsr } from "@utils/session"; import axios from "axios";
import { parseAxiosError, parseAxiosResponse } from "@utils/fetch";
import { parseUserInputError } from "@utils/errors"; import { User } from "@prisma/client";
import { Post } from "@models/post"; import { Post } from "@models/post";
import { Response } from "@models/response"; import { Response } from "@models/response";
import styles from "./new.module.scss"; import { parseUserInputError } from "@utils/errors";
import { parseAxiosError, parseAxiosResponse } from "@utils/fetch";
import { withSessionSsr } from "@utils/session";
import Layout from "@components/Layout";
const NewPostPage: NextPage<{ user: User }> = ({ user }) => { const NewPostPage: NextPage<{ user: User }> = ({ user }) => {
const [title, setTitle] = useState(""); const [title, setTitle] = useState("");

@ -1,22 +1,20 @@
import z from "zod";
import { NextSeo } from "next-seo";
import { GetStaticProps, InferGetStaticPropsType, NextPage } from "next"; import { GetStaticProps, InferGetStaticPropsType, NextPage } from "next";
import { NextSeo } from "next-seo";
import User from "@components/User"; import z from "zod";
import Layout from "@components/Layout";
import FeaturedRepositories from "@components/FeaturedRepositories";
import BestRepository from "@components/BestRepository";
import { RepositoryResponse } from "@models/git/responses"; import { RepositoryResponse } from "@models/git/responses";
import { giteaUsername } from "@utils/config";
import { import {
fetchAvailability, fetchAvailability,
fetchRepositories, fetchRepositories,
fetchUser fetchUser
} from "@utils/git/fetch"; } from "@utils/git/fetch";
import { giteaUsername } from "@utils/config";
import BestRepository from "@components/BestRepository";
import FeaturedRepositories from "@components/FeaturedRepositories";
import Layout from "@components/Layout";
import User from "@components/User";
export const getStaticProps: GetStaticProps = async () => { export const getStaticProps: GetStaticProps = async () => {
const isAvailable = await fetchAvailability(); const isAvailable = await fetchAvailability();

@ -1,21 +1,21 @@
.body { .body {
height: 100vh; height: 100vh;
padding: 10rem 0; padding: 10rem 0;
} }
.title { .title {
text-align: center; text-align: center;
} }
.divider { .divider {
margin: 0 1rem; margin: 0 1rem;
} }
.loginButton, .loginButton,
.signupButton { .signupButton {
width: 100%; width: 100%;
} }
.signupButton { .signupButton {
margin-top: .5rem; margin-top: 0.5rem;
} }

@ -1,19 +1,16 @@
import z from "zod";
import axios from "axios";
import { useQuery } from "@tanstack/react-query"; import { useQuery } from "@tanstack/react-query";
import { NextPage } from "next"; import { NextPage } from "next";
import { NextSeo } from "next-seo"; import { NextSeo } from "next-seo";
import z from "zod";
import Layout from "@components/Layout"; import styles from "./login.module.scss";
import multipleClassNames from "@utils/multipleClassNames"; import axios from "axios";
import { parseAxiosError, parseAxiosResponse } from "@utils/fetch";
import styles from "./login.module.scss"; import { parseAxiosError, parseAxiosResponse } from "@utils/fetch";
import multipleClassNames from "@utils/multipleClassNames";
import Layout from "@components/Layout";
import LoginForm from "@components/LoginForm"; import LoginForm from "@components/LoginForm";
import SignupForm from "@components/SignupForm"; import SignupForm from "@components/SignupForm";

@ -1,108 +1,104 @@
[data-theme="dark"] { [data-theme="dark"] {
body {
body { background-color: $bg-dark;
background-color: $bg-dark; color: $text-primary;
color: $text-primary; }
}
.empty {
.empty { background-color: $bg-dark-secondary;
background-color: $bg-dark-secondary; color: $text-primary;
color: $text-primary; }
}
.card {
.card { background-color: $bg-dark;
background-color: $bg-dark; }
}
.form-input,
.form-input, .form-icon {
.form-icon { background-color: $bg-dark-secondary !important;
background-color: $bg-dark-secondary !important; color: $text-primary;
color: $text-primary; border-color: lighten($bg-dark-secondary, 10%);
border-color: lighten($bg-dark-secondary, 10%); }
}
.divider-vert {
.divider-vert { &::before {
&::before { border-color: lighten($bg-dark-secondary, 10%);
border-color: lighten($bg-dark-secondary, 10%); }
}
&[data-content]::after {
&[data-content]::after { background-color: $bg-dark;
background-color: $bg-dark; }
} }
}
.bg-gray {
.bg-gray { background-color: $bg-dark-secondary !important;
background-color: $bg-dark-secondary !important; }
}
.chip {
.chip { background-color: lighten($bg-dark-secondary, 10%);
background-color: lighten($bg-dark-secondary, 10%); }
}
.divider {
.divider { border-color: $bg-dark-secondary;
border-color: $bg-dark-secondary; }
}
.table {
.table { td,
th {
td, border-color: lighten($bg-dark-secondary, 10%);
th { }
border-color: lighten($bg-dark-secondary, 10%); }
}
} .table tbody tr.active,
.table.table-striped tbody tr.active {
.table tbody tr.active, background: $bg-dark-secondary;
.table.table-striped tbody tr.active { }
background: $bg-dark-secondary
} a:hover {
color: $primary-color-dark;
a:hover { }
color: $primary-color-dark;
} a {
color: $primary-color;
a { }
color: $primary-color;
} .text-primary {
color: $primary-color !important;
.text-primary { }
color: $primary-color !important;
} .bg-primary {
background-color: $primary-color !important;
.bg-primary { }
background-color: $primary-color !important;
} .btn {
background-color: $bg-dark-secondary;
.btn { color: $primary-color;
background-color: $bg-dark-secondary;
color: $primary-color; border-color: $primary-color;
border-color: $primary-color; &:hover {
border-color: $primary-color;
&:hover { }
border-color: $primary-color;
} &:focus {
border-color: $primary-color;
&:focus { }
border-color: $primary-color; }
}
} .btn-primary {
background-color: $primary-color;
.btn-primary { border-color: $primary-color;
background-color: $primary-color;
border-color: $primary-color; color: $text-primary;
color: $text-primary; &:hover {
background-color: $primary-color-dark;
&:hover { border-color: $primary-color-dark;
background-color: $primary-color-dark; }
border-color: $primary-color-dark;
} &:focus {
background-color: $primary-color-dark;
&:focus { border-color: $primary-color-dark;
background-color: $primary-color-dark; }
border-color: $primary-color-dark; }
} }
}
}

@ -10,4 +10,4 @@ $bg-dark: $dark-color;
$bg-dark-secondary: $dark-color-secondary; $bg-dark-secondary: $dark-color-secondary;
$text-primary: $light-color; $text-primary: $light-color;
$text-secondary: darken($light-color, 10%); $text-secondary: darken($light-color, 10%);

@ -6,5 +6,5 @@
@import "dark"; @import "dark";
p { p {
line-height: 1.25rem; line-height: 1.25rem;
} }

@ -1,7 +1,6 @@
import axios from "axios";
import z from "zod"; import z from "zod";
import createConfigCatClient from "@utils/createConfigCatClient"; import axios from "axios";
import { import {
RepositoryResponse, RepositoryResponse,
@ -10,6 +9,7 @@ import {
} from "@models/git/responses"; } from "@models/git/responses";
import { giteaServerUrl } from "@utils/config"; import { giteaServerUrl } from "@utils/config";
import createConfigCatClient from "@utils/createConfigCatClient";
const apiUrl = `https://${giteaServerUrl}/api/v1`; const apiUrl = `https://${giteaServerUrl}/api/v1`;

@ -5,10 +5,10 @@ import {
NextApiHandler NextApiHandler
} from "next"; } from "next";
import { User } from "@prisma/client";
import { sessionOptions } from "./config"; import { sessionOptions } from "./config";
import { User } from "@prisma/client";
export const withIronSession = (handler: NextApiHandler) => export const withIronSession = (handler: NextApiHandler) =>
withIronSessionApiRoute(handler, sessionOptions); withIronSessionApiRoute(handler, sessionOptions);

Loading…
Cancel
Save