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 { FC } from "react";
import { format as formatTimeAgo } from "timeago.js";
import z from "zod";
import { format as formatTimeAgo } from "timeago.js";
import { FC } from "react";
import { RepositoryResponse } from "@models/git/responses";

@ -1,15 +1,14 @@
import z from "zod";
import { FC } from "react";
import Link from "next/link";
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 styles from "./repositories.module.scss";
import multipleClassNames from "@utils/multipleClassNames";
const FeaturedRepositories: FC<{
repositories: z.infer<typeof RepositoryResponse>[];

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

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

@ -1,14 +1,14 @@
import { FC } from "react";
import Link from "next/link";
import styles from "./post.module.scss";
import { FC } from "react";
import { Post, User } from "@prisma/client";
import multipleClassNames from "@utils/multipleClassNames";
import styles from "./post.module.scss";
const Post: FC<{
const PostsPage: FC<{
post: Post & {
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 { useRouter } from "next/router";
import axios from "axios";
import { SignupCredentials } from "@models/signup";
import { Response } from "@models/response";
import { SignupCredentials } from "@models/signup";
import { parseAxiosError, parseAxiosResponse } from "@utils/fetch";
import { parseUserInputError } from "@utils/errors";
import { parseAxiosError, parseAxiosResponse } from "@utils/fetch";
const SignupForm: FC = () => {
const [email, setEmail] = useState("");

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

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

@ -3,7 +3,6 @@
margin-bottom: 2rem;
}
.avatar {
border-radius: 5px;
}

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

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

@ -1,14 +1,14 @@
import { NextPage } from "next";
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 { withSessionSsr } from "@utils/session";
import styles from "./admin.module.scss";
import Layout from "@components/Layout";
const AdminPage: NextPage<{
user: User;

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

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

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

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

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

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

@ -1,5 +1,4 @@
.body {
padding: 10rem 1rem;
@media (max-width: 840px) {

@ -1,16 +1,15 @@
import { GetStaticProps, NextPage } from "next";
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 Layout from "@components/Layout";
import PostComponent from "@components/Post";
import styles from "./blog.module.scss";
const Blog: NextPage<{
posts: (Post & {
author: User;

@ -1,23 +1,23 @@
import axios from "axios";
import { FormEvent, useCallback, useState } from "react";
import { NextPage } from "next";
import { NextSeo } from "next-seo";
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 { parseAxiosError, parseAxiosResponse } from "@utils/fetch";
import { parseUserInputError } from "@utils/errors";
import axios from "axios";
import { User } from "@prisma/client";
import { Post } from "@models/post";
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 [title, setTitle] = useState("");

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

@ -17,5 +17,5 @@
}
.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 { NextPage } from "next";
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 { parseAxiosError, parseAxiosResponse } from "@utils/fetch";
import axios from "axios";
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 SignupForm from "@components/SignupForm";

@ -1,5 +1,4 @@
[data-theme="dark"] {
body {
background-color: $bg-dark;
color: $text-primary;
@ -44,7 +43,6 @@
}
.table {
td,
th {
border-color: lighten($bg-dark-secondary, 10%);
@ -53,7 +51,7 @@
.table tbody tr.active,
.table.table-striped tbody tr.active {
background: $bg-dark-secondary
background: $bg-dark-secondary;
}
a:hover {
@ -103,6 +101,4 @@
border-color: $primary-color-dark;
}
}
}

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

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

Loading…
Cancel
Save