Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { StandardWidth } from "@app/components";
import { type OrganizationPage_OrganizationFragment } from "@app/graphql";
import { Layout, Menu, Typography } from "antd";
import Link from "next/link";
import React, { useMemo } from "react";

import { contentMinHeight } from "./SharedLayout";
import { StandardWidth } from "./StandardWidth";

type TextProps = React.ComponentProps<typeof Typography.Text>;
const { Text } = Typography;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { NetworkStatus, useApolloClient } from "@apollo/client";
import { H3, StandardWidth } from "@app/components";
import { Skeleton } from "antd";
import Router from "next/router";
import React, { useEffect } from "react";

import { SharedLayout } from "./SharedLayout";
import { StandardWidth } from "./StandardWidth";
import { H3 } from "./Text";

export interface RedirectProps {
href: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { StandardWidth, Warn } from "@app/components";
import { Layout, Menu, Typography } from "antd";
import Link from "next/link";
import { type NextRouter, useRouter } from "next/router";
Expand All @@ -12,8 +13,6 @@ import {
type SharedLayoutChildProps,
type SharedLayoutProps,
} from "./SharedLayout";
import { StandardWidth } from "./StandardWidth";
import { Warn } from "./Warn";

type TextProps = React.ComponentProps<typeof Typography.Text>;
const { Text } = Typography;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
type QueryResult,
useApolloClient,
} from "@apollo/client";
import { ErrorAlert, H3, StandardWidth, Warn } from "@app/components";
import { companyName, projectName } from "@app/config";
import {
type SharedLayout_QueryFragment,
Expand All @@ -18,22 +19,10 @@ import Router, { useRouter } from "next/router";
import * as React from "react";
import { useCallback } from "react";

import { ErrorAlert, H3, StandardWidth, Warn } from ".";
import { Redirect } from "./Redirect";

const { Header, Content, Footer } = Layout;
const { Text } = Typography;
/*
* For some reason, possibly related to the interaction between
* `babel-plugin-import` and https://github.com/babel/babel/pull/9766, we can't
* directly export these values, but if we reference them and re-export then we
* can.
*
* TODO: change back to `export { Row, Col, Link }` when this issue is fixed.
*/
const _babelHackRow = Row;
const _babelHackCol = Col;
export { _babelHackCol as Col, Link, _babelHackRow as Row };

export const contentMinHeight = "calc(100vh - 64px - 70px)";

Expand Down
10 changes: 3 additions & 7 deletions @app/client/src/pages/_error.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import {
ErrorOccurred,
FourOhFour,
H2,
P,
SharedLayout,
} from "@app/components";
import { ErrorOccurred, FourOhFour, H2, P } from "@app/components";
import { useSharedQuery } from "@app/graphql";
import { Alert, Col, Row } from "antd";
import { type NextPage } from "next";
import Link from "next/link";
import * as React from "react";

import { SharedLayout } from "../layouts/SharedLayout";

const isDev = process.env.NODE_ENV !== "production";

interface SocialAuthErrorProps {
Expand Down
4 changes: 3 additions & 1 deletion @app/client/src/pages/create-organization/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { PageHeader } from "@ant-design/pro-layout";
import { type ApolloError } from "@apollo/client";
import { AuthRestrict, Redirect, SharedLayout } from "@app/components";
import {
type CreatedOrganizationFragment,
useCreateOrganizationMutation,
Expand All @@ -20,6 +19,9 @@ import { type Store } from "rc-field-form/lib/interface";
import React, { useCallback, useEffect, useMemo, useState } from "react";
import slugify from "slugify";

import { Redirect } from "../../layouts/Redirect";
import { AuthRestrict, SharedLayout } from "../../layouts/SharedLayout";

const { useForm } = Form;
const { Text } = Typography;

Expand Down
3 changes: 2 additions & 1 deletion @app/client/src/pages/forgot.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { UserOutlined } from "@ant-design/icons";
import { type ApolloError } from "@apollo/client";
import { AuthRestrict, SharedLayout } from "@app/components";
import { useForgotPasswordMutation, useSharedQuery } from "@app/graphql";
import { extractError, getCodeFromError } from "@app/lib";
import { Alert, Button, Form, Input, type InputRef } from "antd";
Expand All @@ -9,6 +8,8 @@ import Link from "next/link";
import { type Store } from "rc-field-form/lib/interface";
import React, { useCallback, useEffect, useRef, useState } from "react";

import { AuthRestrict, SharedLayout } from "../layouts/SharedLayout";

const { useForm } = Form;

const ForgotPassword: NextPage = () => {
Expand Down
3 changes: 2 additions & 1 deletion @app/client/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Button, Col, Divider, Row, Typography } from "antd";
import * as React from "react";
const { Text, Title, Paragraph } = Typography;
import { SharedLayout } from "@app/components";
import { useSharedQuery } from "@app/graphql";
import { type NextPage } from "next";

import { SharedLayout } from "../layouts/SharedLayout";

// Convenience helper
const Li = ({ children, ...props }: any) => (
<li {...props}>
Expand Down
12 changes: 4 additions & 8 deletions @app/client/src/pages/invitations/accept.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import { type QueryResult } from "@apollo/client";
import {
AuthRestrict,
ButtonLink,
ErrorAlert,
Redirect,
SharedLayout,
SpinPadded,
} from "@app/components";
import { ButtonLink, ErrorAlert, SpinPadded } from "@app/components";
import {
type InvitationDetailQuery,
type InvitationDetailQueryVariables,
Expand All @@ -21,6 +14,9 @@ import Router, { type NextRouter, useRouter } from "next/router";
import * as qs from "querystring";
import React, { type FC } from "react";

import { Redirect } from "../../layouts/Redirect";
import { AuthRestrict, SharedLayout } from "../../layouts/SharedLayout";

interface IProps {
id: string | null;
code: string | null;
Expand Down
18 changes: 8 additions & 10 deletions @app/client/src/pages/login.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
import { LockOutlined, UserAddOutlined, UserOutlined } from "@ant-design/icons";
import { type ApolloError, useApolloClient } from "@apollo/client";
import {
AuthRestrict,
ButtonLink,
Col,
Redirect,
Row,
SharedLayout,
type SharedLayoutChildProps,
SocialLoginOptions,
} from "@app/components";
import { ButtonLink, Col, Row, SocialLoginOptions } from "@app/components";
import { useLoginMutation, useSharedQuery } from "@app/graphql";
import {
extractError,
Expand All @@ -23,6 +14,13 @@ import Router from "next/router";
import { type Store } from "rc-field-form/lib/interface";
import React, { useCallback, useEffect, useRef, useState } from "react";

import { Redirect } from "../layouts/Redirect";
import {
AuthRestrict,
SharedLayout,
type SharedLayoutChildProps,
} from "../layouts/SharedLayout";

interface LoginProps {
next: string | null;
}
Expand Down
3 changes: 2 additions & 1 deletion @app/client/src/pages/o/[slug]/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { PageHeader } from "@ant-design/pro-layout";
import {
ButtonLink,
SharedLayout,
useOrganizationLoading,
useOrganizationSlug,
} from "@app/components";
Expand All @@ -13,6 +12,8 @@ import { Col, Empty, Row } from "antd";
import { type NextPage } from "next";
import React, { type FC } from "react";

import { SharedLayout } from "../../../layouts/SharedLayout";

const OrganizationPage: NextPage = () => {
const slug = useOrganizationSlug();
const query = useOrganizationPageQuery({ variables: { slug } });
Expand Down
6 changes: 3 additions & 3 deletions @app/client/src/pages/o/[slug]/settings/delete.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { PageHeader } from "@ant-design/pro-layout";
import { type ApolloError } from "@apollo/client";
import {
AuthRestrict,
ErrorAlert,
OrganizationSettingsLayout,
P,
SharedLayout,
useOrganizationLoading,
useOrganizationSlug,
} from "@app/components";
Expand All @@ -20,6 +17,9 @@ import { type NextPage } from "next";
import { useRouter } from "next/router";
import React, { type FC, useCallback, useState } from "react";

import { OrganizationSettingsLayout } from "../../../../layouts/OrganizationSettingsLayout";
import { AuthRestrict, SharedLayout } from "../../../../layouts/SharedLayout";

const OrganizationSettingsPage: NextPage = () => {
const slug = useOrganizationSlug();
const query = useOrganizationPageQuery({ variables: { slug } });
Expand Down
13 changes: 5 additions & 8 deletions @app/client/src/pages/o/[slug]/settings/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import { PageHeader } from "@ant-design/pro-layout";
import {
AuthRestrict,
OrganizationSettingsLayout,
Redirect,
SharedLayout,
useOrganizationLoading,
useOrganizationSlug,
} from "@app/components";
import { useOrganizationLoading, useOrganizationSlug } from "@app/components";
import {
type OrganizationPage_OrganizationFragment,
useOrganizationPageQuery,
Expand All @@ -19,6 +12,10 @@ import Router, { useRouter } from "next/router";
import { type Store } from "rc-field-form/lib/interface";
import React, { type FC, useCallback, useState } from "react";

import { OrganizationSettingsLayout } from "../../../../layouts/OrganizationSettingsLayout";
import { Redirect } from "../../../../layouts/Redirect";
import { AuthRestrict, SharedLayout } from "../../../../layouts/SharedLayout";

const { useForm } = Form;

const OrganizationSettingsPage: NextPage = () => {
Expand Down
13 changes: 5 additions & 8 deletions @app/client/src/pages/o/[slug]/settings/members.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import { PageHeader } from "@ant-design/pro-layout";
import {
AuthRestrict,
OrganizationSettingsLayout,
Redirect,
SharedLayout,
useOrganizationLoading,
useOrganizationSlug,
} from "@app/components";
import { useOrganizationLoading, useOrganizationSlug } from "@app/components";
import {
type OrganizationMembers_MembershipFragment,
type OrganizationMembers_OrganizationFragment,
Expand Down Expand Up @@ -34,6 +27,10 @@ import { useRouter } from "next/router";
import { type Store } from "rc-field-form/lib/interface";
import React, { type FC, useCallback, useState } from "react";

import { OrganizationSettingsLayout } from "../../../../layouts/OrganizationSettingsLayout";
import { Redirect } from "../../../../layouts/Redirect";
import { AuthRestrict, SharedLayout } from "../../../../layouts/SharedLayout";

const { useForm } = Form;

const OrganizationSettingsPage: NextPage = () => {
Expand Down
9 changes: 3 additions & 6 deletions @app/client/src/pages/register.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { QuestionCircleOutlined } from "@ant-design/icons";
import { type ApolloError, useApolloClient } from "@apollo/client";
import {
AuthRestrict,
PasswordStrength,
Redirect,
SharedLayout,
} from "@app/components";
import { PasswordStrength } from "@app/components";
import { useRegisterMutation, useSharedQuery } from "@app/graphql";
import {
extractError,
Expand All @@ -28,6 +23,8 @@ import React, {
useState,
} from "react";

import { Redirect } from "../layouts/Redirect";
import { AuthRestrict, SharedLayout } from "../layouts/SharedLayout";
import { isSafe } from "./login";

const { useForm } = Form;
Expand Down
10 changes: 3 additions & 7 deletions @app/client/src/pages/reset.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import {
AuthRestrict,
Col,
PasswordStrength,
Row,
SharedLayout,
} from "@app/components";
import { Col, PasswordStrength, Row } from "@app/components";
import { useResetPasswordMutation, useSharedQuery } from "@app/graphql";
import { formItemLayout, setPasswordInfo, tailFormItemLayout } from "@app/lib";
import { Alert, Button, Form, Input } from "antd";
Expand All @@ -13,6 +7,8 @@ import { type NextPage } from "next";
import { type Store } from "rc-field-form/lib/interface";
import React, { type FocusEvent, useCallback, useState } from "react";

import { AuthRestrict, SharedLayout } from "../layouts/SharedLayout";

const { useForm } = Form;

interface IProps {
Expand Down
3 changes: 2 additions & 1 deletion @app/client/src/pages/settings/accounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { GithubFilled } from "@ant-design/icons";
import { PageHeader } from "@ant-design/pro-layout";
import {
ErrorAlert,
SettingsLayout,
SocialLoginOptions,
SpinPadded,
Strong,
Expand All @@ -17,6 +16,8 @@ import { Avatar, Card, List, Modal, Spin } from "antd";
import { type NextPage } from "next";
import React, { useCallback, useState } from "react";

import { SettingsLayout } from "../../layouts/SettingsLayout";

const AUTH_NAME_LOOKUP: Record<string, string | undefined> = {
github: "GitHub",
facebook: "Facebook",
Expand Down
4 changes: 3 additions & 1 deletion @app/client/src/pages/settings/delete.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PageHeader } from "@ant-design/pro-layout";
import { type ApolloError } from "@apollo/client";
import { ErrorAlert, P, SettingsLayout } from "@app/components";
import { ErrorAlert, P } from "@app/components";
import {
useConfirmAccountDeletionMutation,
useRequestAccountDeletionMutation,
Expand All @@ -12,6 +12,8 @@ import { type NextPage } from "next";
import { useRouter } from "next/router";
import React, { useCallback, useState } from "react";

import { SettingsLayout } from "../../layouts/SettingsLayout";

const { Text } = Typography;

const Settings_Accounts: NextPage = () => {
Expand Down
11 changes: 4 additions & 7 deletions @app/client/src/pages/settings/emails.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import { PageHeader } from "@ant-design/pro-layout";
import { type ApolloError } from "@apollo/client";
import {
ErrorAlert,
P,
Redirect,
SettingsLayout,
Strong,
} from "@app/components";
import { ErrorAlert, P, Strong } from "@app/components";
import {
type EmailsForm_UserEmailFragment,
useAddEmailMutation,
Expand All @@ -26,6 +20,9 @@ import { type NextPage } from "next";
import { type Store } from "rc-field-form/lib/interface";
import React, { useCallback, useState } from "react";

import { Redirect } from "../../layouts/Redirect";
import { SettingsLayout } from "../../layouts/SettingsLayout";

const { useForm } = Form;

function Email({
Expand Down
5 changes: 4 additions & 1 deletion @app/client/src/pages/settings/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PageHeader } from "@ant-design/pro-layout";
import { type ApolloError } from "@apollo/client";
import { ErrorAlert, Redirect, SettingsLayout } from "@app/components";
import { ErrorAlert } from "@app/components";
import {
type ProfileSettingsForm_UserFragment,
useSettingsProfileQuery,
Expand All @@ -17,6 +17,9 @@ import { type NextPage } from "next";
import { type Store } from "rc-field-form/lib/interface";
import React, { useCallback, useState } from "react";

import { Redirect } from "../../layouts/Redirect";
import { SettingsLayout } from "../../layouts/SettingsLayout";

const { useForm } = Form;

const Settings_Profile: NextPage = () => {
Expand Down
Loading
Loading