Login:App:Confirm: move client components and styles for pages

This commit is contained in:
Darya Umrikhina 2024-08-28 18:55:38 +04:00
parent 528875b43c
commit 1ec5c740f6
32 changed files with 51 additions and 143 deletions

View File

@ -53,10 +53,9 @@ import {
} from "@docspace/shared/api/people";
import { TActivateConfirmUser, TError } from "@/types";
import { RegisterContainer } from "../CreateUserForm/CreateUserForm.styled";
import { GreetingUserContainer } from "../CreateUserForm/sub-components/GreetingUserContainer";
import { ConfirmRouteContext } from "../ConfirmRoute";
import { ConfirmRouteContext } from "@/components/ConfirmRoute";
import { RegisterContainer } from "@/components/RegisterContainer.styled";
import { GreetingUserContainer } from "@/components/GreetingContainer";
type ActivateUserFormPorps = {
passwordHash: TPasswordHash;

View File

@ -27,11 +27,11 @@
import { headers } from "next/headers";
import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import { getPortalPasswordSettings, getSettings } from "@/utils/actions";
import ActivateUserForm from "@/components/ActivateUserForm";
import { GreetingCreateUserContainer } from "@/components/GreetingContainer";
import ActivateUserForm from "./page.client";
type ActivationProps = {
searchParams: { [key: string]: string };
};

View File

@ -40,8 +40,7 @@ import { loginWithConfirmKey } from "@docspace/shared/api/user";
import OperationContainer from "@docspace/shared/components/operation-container";
import { TError } from "@/types";
import { ConfirmRouteContext } from "../ConfirmRoute";
import { ConfirmRouteContext } from "@/components/ConfirmRoute";
const AuthHandler = () => {
let searchParams = useSearchParams();

View File

@ -24,7 +24,7 @@
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
import AuthHandler from "@/components/AuthHandler";
import AuthHandler from "./page.client";
async function Page() {
return <AuthHandler />;

View File

@ -33,8 +33,7 @@ import AppLoader from "@docspace/shared/components/app-loader";
import { updateActivationStatus } from "@docspace/shared/api/people";
import { TError } from "@/types";
import { ConfirmRouteContext } from "../ConfirmRoute";
import { ConfirmRouteContext } from "@/components/ConfirmRoute";
const EmailActivationHandler = () => {
const [error, setError] = useState<string>();

View File

@ -24,7 +24,7 @@
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
import EmailActivationHandler from "@/components/EmailActivationHandler";
import EmailActivationHandler from "./page.client";
async function Page() {
return <EmailActivationHandler />;

View File

@ -32,8 +32,7 @@ import AppLoader from "@docspace/shared/components/app-loader";
import { changeEmail } from "@docspace/shared/api/people";
import { TError } from "@/types";
import { ConfirmRouteContext } from "../ConfirmRoute";
import { ConfirmRouteContext } from "@/components/ConfirmRoute";
const EmailChangeHandler = () => {
const [error, setError] = useState<string>();

View File

@ -24,7 +24,7 @@
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
import EmailChangeHandler from "@/components/EmailChangeHandler";
import EmailChangeHandler from "./page.client";
async function Page() {
return <EmailChangeHandler />;

View File

@ -46,7 +46,7 @@ import { changePassword } from "@docspace/shared/api/people";
import { ButtonKeys } from "@docspace/shared/enums";
import { TError } from "@/types";
import { ConfirmRouteContext } from "../ConfirmRoute";
import { ConfirmRouteContext } from "@/components/ConfirmRoute";
type PasswordChangeFormProps = {
passwordHash: TPasswordHash;

View File

@ -27,9 +27,10 @@
import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import { GreetingContainer } from "@/components/GreetingContainer";
import PasswordChangeForm from "@/components/PasswordChangeForm";
import { getPortalPasswordSettings, getSettings } from "@/utils/actions";
import PasswordChangeForm from "./page.client";
async function Page() {
const [settings, passwordSettings] = await Promise.all([
getSettings(),

View File

@ -28,7 +28,8 @@ import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import { GreetingContainer } from "@/components/GreetingContainer";
import { getSettings } from "@/utils/actions";
import ChangePhoneForm from "@/components/ChangePhoneForm";
import ChangePhoneForm from "./page.client";
async function Page() {
const settings = await getSettings();

View File

@ -36,9 +36,8 @@ import { Button, ButtonSize } from "@docspace/shared/components/button";
import { continuePortal } from "@docspace/shared/api/portal";
import { TError } from "@/types";
import { ConfirmRouteContext } from "../ConfirmRoute";
import { ButtonsWrapper } from "../Confirm.styled";
import { ConfirmRouteContext } from "@/components/ConfirmRoute";
import { ButtonsWrapper } from "@/components/Confirm.styled";
const ContinuePortalForm = () => {
const { t } = useTranslation(["Confirm", "Common"]);

View File

@ -28,7 +28,8 @@ import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import { GreetingContainer } from "@/components/GreetingContainer";
import { getSettings } from "@/utils/actions";
import ContinuePortalForm from "@/components/ContinuePortalForm";
import ContinuePortalForm from "./page.client";
async function Page() {
const settings = await getSettings();

View File

@ -35,9 +35,8 @@ import { toastr } from "@docspace/shared/components/toast";
import { ownerChange } from "@docspace/shared/api/settings";
import { TError } from "@/types";
import { ConfirmRouteContext } from "../ConfirmRoute";
import { ButtonsWrapper } from "../Confirm.styled";
import { ConfirmRouteContext } from "@/components/ConfirmRoute";
import { ButtonsWrapper } from "@/components/Confirm.styled";
type ChangeOwnerFormProps = {
newOwner?: string;

View File

@ -29,7 +29,8 @@ import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import { GreetingContainer } from "@/components/GreetingContainer";
import { getStringFromSearchParams } from "@/utils";
import { getSettings, getUserFromConfirm } from "@/utils/actions";
import ChangeOwnerForm from "@/components/ChangeOwnerForm";
import ChangeOwnerForm from "./page.client";
type PortalOwnerChangeProps = {
searchParams: { [key: string]: string };

View File

@ -37,9 +37,8 @@ import { toastr } from "@docspace/shared/components/toast";
import { TError } from "@/types";
import { URL_ONLYOFFICE } from "@/utils/constants";
import { ConfirmRouteContext } from "../ConfirmRoute";
import { ButtonsWrapper } from "../Confirm.styled";
import { ConfirmRouteContext } from "@/components/ConfirmRoute";
import { ButtonsWrapper } from "@/components/Confirm.styled";
type RemovePortalFormProps = {
siteUrl?: string;

View File

@ -28,7 +28,8 @@ import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import { GreetingContainer } from "@/components/GreetingContainer";
import { getCompanyInfoSettings, getSettings } from "@/utils/actions";
import RemovePortalForm from "@/components/RemovePortalForm";
import RemovePortalForm from "./page.client";
async function Page() {
const [settings, companyInfoSettings] = await Promise.all([

View File

@ -37,9 +37,8 @@ import { suspendPortal } from "@docspace/shared/api/portal";
import { TError } from "@/types";
import { URL_ONLYOFFICE } from "@/utils/constants";
import { ButtonsWrapper } from "../Confirm.styled";
import { ConfirmRouteContext } from "../ConfirmRoute";
import { ConfirmRouteContext } from "@/components/ConfirmRoute";
import { ButtonsWrapper } from "@/components/Confirm.styled";
type DeactivatePortalProps = {
siteUrl?: string;

View File

@ -28,7 +28,8 @@ import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import { GreetingContainer } from "@/components/GreetingContainer";
import { getCompanyInfoSettings, getSettings } from "@/utils/actions";
import DeactivatePortalForm from "@/components/DeactivatePortalForm";
import DeactivatePortalForm from "./page.client";
async function Page() {
const [settings, companyInfoSettings] = await Promise.all([

View File

@ -38,9 +38,8 @@ import { toastr } from "@docspace/shared/components/toast";
import { deleteSelf } from "@docspace/shared/api/people";
import { TError } from "@/types";
import { GreetingContainer } from "../GreetingContainer";
import { ConfirmRouteContext } from "../ConfirmRoute";
import { ConfirmRouteContext } from "@/components/ConfirmRoute";
import { GreetingContainer } from "@/components/GreetingContainer";
type ProfileRemoveFormProps = {
legalTerms: string;

View File

@ -25,7 +25,8 @@
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
import { getSettings } from "@/utils/actions";
import ProfileRemoveForm from "@/components/ProfileRemoveForm";
import ProfileRemoveForm from "./page.client";
async function Page() {
const settings = await getSettings();

View File

@ -57,9 +57,8 @@ import {
TFA_WIN_APP_URL,
} from "@/utils/constants";
import { TError } from "@/types";
import { ConfirmRouteContext } from "../ConfirmRoute";
import { GreetingContainer } from "../GreetingContainer";
import { ConfirmRouteContext } from "@/components/ConfirmRoute";
import { GreetingContainer } from "@/components/GreetingContainer";
type TfaActivationFormProps = {
secretKey: string;

View File

@ -24,8 +24,6 @@
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
import TfaActivationForm from "@/components/TfaActivationForm";
import { StyledForm } from "@/components/TfaActivationForm/TfaActivationForm.styled";
import { getStringFromSearchParams } from "@/utils";
import {
getSettings,
@ -33,6 +31,9 @@ import {
getUserFromConfirm,
} from "@/utils/actions";
import { StyledForm } from "./page.styled";
import TfaActivationForm from "./page.client";
type TfaActivationProps = {
searchParams: { [key: string]: string };
};

View File

@ -46,8 +46,7 @@ import { TPasswordHash } from "@docspace/shared/api/settings/types";
import { ButtonKeys } from "@docspace/shared/enums";
import { TError } from "@/types";
import { ConfirmRouteContext } from "../ConfirmRoute";
import { ConfirmRouteContext } from "@/components/ConfirmRoute";
type TfaAuthFormProps = {
passwordHash: TPasswordHash;

View File

@ -27,10 +27,11 @@
import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import { GreetingContainer } from "@/components/GreetingContainer";
import TfaAuthForm from "@/components/TfaAuthForm";
import { getStringFromSearchParams } from "@/utils";
import { getSettings, getUserFromConfirm } from "@/utils/actions";
import TfaAuthForm from "./page.client";
type TfaAuthProps = {
searchParams: { [key: string]: string };
};

View File

@ -41,8 +41,7 @@ import {
import { ALLOWED_PASSWORD_CHARACTERS } from "@docspace/shared/constants";
import { ConfirmRouteContext } from "@/components/ConfirmRoute";
import { GreetingUserContainer } from "./GreetingUserContainer";
import { GreetingUserContainer } from "@/components/GreetingContainer";
type RegistrationFormProps = {
isLoading: boolean;

View File

@ -37,6 +37,7 @@ import {
useState,
} from "react";
import { useTranslation } from "react-i18next";
import { useRouter } from "next/navigation";
import {
TCapabilities,
@ -71,12 +72,10 @@ import {
import SsoReactSvg from "PUBLIC_DIR/images/sso.react.svg";
import useDeviceType from "@/hooks/useDeviceType";
import { ConfirmRouteContext } from "../ConfirmRoute";
import EmailInputForm from "./sub-components/EmailInputForm";
import RegistrationForm from "./sub-components/RegistrationForm";
import { RegisterContainer } from "./CreateUserForm.styled";
import { useRouter } from "next/navigation";
import { ConfirmRouteContext } from "@/components/ConfirmRoute";
import { RegisterContainer } from "@/components/RegisterContainer.styled";
import EmailInputForm from "./_sub-components/EmailInputForm";
import RegistrationForm from "./_sub-components/RegistrationForm";
export type CreateUserFormProps = {
userNameRegex: string;

View File

@ -30,7 +30,6 @@ import { cookies, headers } from "next/headers";
import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import { LANGUAGE } from "@docspace/shared/constants";
import CreateUserForm from "@/components/CreateUserForm";
import { GreetingCreateUserContainer } from "@/components/GreetingContainer";
import { getStringFromSearchParams } from "@/utils";
import {
@ -40,6 +39,7 @@ import {
getThirdPartyProviders,
getUserFromConfirm,
} from "@/utils/actions";
import CreateUserForm from "./page.client";
type LinkInviteProps = {
searchParams: { [key: string]: string };

View File

@ -1,88 +0,0 @@
// (c) Copyright Ascensio System SIA 2009-2024
//
// This program is a free software product.
// You can redistribute it and/or modify it under the terms
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
// any third-party rights.
//
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
//
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
//
// The interactive user interfaces in modified source and object code versions of the Program must
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
//
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
// trademark law for use of our trademarks.
//
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
"use client";
import styled from "styled-components";
import { mobile, tablet } from "@docspace/shared/utils";
export const RegisterContainer = styled.div<{
registrationForm?: boolean;
}>`
height: 100%;
width: 100%;
.or-label {
color: ${(props) => props.theme.invitePage.textColor};
margin: 0 8px;
}
.line {
display: flex;
width: 100%;
align-items: center;
color: ${(props) => props.theme.invitePage.borderColor};
padding: 32px 0;
@media ${mobile} {
padding: 24px 0;
}
}
.line:before,
.line:after {
content: "";
flex-grow: 1;
background: ${(props) => props.theme.invitePage.borderColor};
height: 1px;
font-size: 0px;
line-height: 0px;
margin: 0px;
}
.auth-form-fields {
width: 100%;
.password-field{
margin-bottom: 24px;
}
.email-container{
${(props) => props.registrationForm && "display:none"};
}
@media ${tablet} {
width: 100%;
}
@media ${mobile} {
width: 100%;
}
}
.password-field-wrapper {
min-width: 100%;
}
}`;