From 1afccdd191e3b2d0797b51041b3b4124df8b594e Mon Sep 17 00:00:00 2001 From: prplwtf Date: Wed, 31 Jan 2024 22:14:11 +0100 Subject: [PATCH] feat `core` `components`: Add new component options --- blueprint.sh | 9 ++- .../Authentication/Container/AfterContent.tsx | 10 ++++ .../Container/BeforeContent.tsx | 10 ++++ .../components/auth/LoginFormContainer.tsx | 60 +++++++++++++++++++ 4 files changed, 86 insertions(+), 3 deletions(-) create mode 100644 resources/scripts/blueprint/components/Authentication/Container/AfterContent.tsx create mode 100644 resources/scripts/blueprint/components/Authentication/Container/BeforeContent.tsx create mode 100644 resources/scripts/components/auth/LoginFormContainer.tsx diff --git a/blueprint.sh b/blueprint.sh index 7f6045b..06fd812 100644 --- a/blueprint.sh +++ b/blueprint.sh @@ -714,6 +714,9 @@ if [[ ( $2 == "-i" ) || ( $2 == "-install" ) ]]; then VCMD="y" PLACE_REACT "$Components_Dashboard_ServerRow_AfterEntryDescription" "Dashboard/ServerRow/AfterEntryDescription.tsx" "$OldComponents_Dashboard_ServerRow_AfterEntryDescription" PLACE_REACT "$Components_Dashboard_ServerRow_ResourceLimits" "Dashboard/ServerRow/ResourceLimits.tsx" "$OldComponents_Dashboard_ServerRow_ResourceLimits" + # authentication + PLACE_REACT "$Components_Authentication_Container_BeforeContent" "Authentication/Container/BeforeContent.tsx" "$OldComponents_Authentication_Container_BeforeContent" + PLACE_REACT "$Components_Authentication_Container_AfterContent" "Authentication/Container/AfterContent.tsx" "$OldComponents_Authentication_Container_AfterContent" # server PLACE_REACT "$Components_Server_Terminal_BeforeContent" "Server/Terminal/BeforeContent.tsx" "$OldComponents_Server_Terminal_BeforeContent" @@ -750,7 +753,6 @@ if [[ ( $2 == "-i" ) || ( $2 == "-install" ) ]]; then VCMD="y" PLACE_REACT "$Components_Server_Settings_BeforeContent" "Server/Settings/BeforeContent.tsx" "$OldComponents_Server_Settings_BeforeContent" PLACE_REACT "$Components_Server_Settings_AfterContent" "Server/Settings/AfterContent.tsx" "$OldComponents_Server_Settings_AfterContent" - # account PLACE_REACT "$Components_Account_Overview_BeforeContent" "Account/Overview/BeforeContent.tsx" "$OldComponents_Account_Overview_BeforeContent" PLACE_REACT "$Components_Account_Overview_AfterContent" "Account/Overview/AfterContent.tsx" "$OldComponents_Account_Overview_AfterContent" @@ -1347,7 +1349,6 @@ if [[ ( $2 == "-r" ) || ( $2 == "-remove" ) ]]; then VCMD="y" REMOVE_REACT "$Components_Navigation_SubNavigation_AdditionalAccountItems" "Navigation/SubNavigation/AdditionalAccountItems.tsx" REMOVE_REACT "$Components_Navigation_SubNavigation_AfterSubNavigation" "Navigation/SubNavigation/AfterSubNavigation.tsx" - # dashboard REMOVE_REACT "$Components_Dashboard_ServerRow_BeforeEntryName" "Dashboard/ServerRow/BeforeEntryName.tsx" REMOVE_REACT "$Components_Dashboard_ServerRow_AfterEntryName" "Dashboard/ServerRow/AfterEntryName.tsx" @@ -1355,6 +1356,9 @@ if [[ ( $2 == "-r" ) || ( $2 == "-remove" ) ]]; then VCMD="y" REMOVE_REACT "$Components_Dashboard_ServerRow_AfterEntryDescription" "Dashboard/ServerRow/AfterEntryDescription.tsx" REMOVE_REACT "$Components_Dashboard_ServerRow_ResourceLimits" "Dashboard/ServerRow/ResourceLimits.tsx" + # authentication + REMOVE_REACT "$Components_Authentication_Container_BeforeContent" "Authentication/Container/BeforeContent.tsx" + REMOVE_REACT "$Components_Authentication_Container_AfterContent" "Authentication/Container/AfterContent.tsx" # server REMOVE_REACT "$Components_Server_Terminal_BeforeContent" "Server/Terminal/BeforeContent.tsx" @@ -1391,7 +1395,6 @@ if [[ ( $2 == "-r" ) || ( $2 == "-remove" ) ]]; then VCMD="y" REMOVE_REACT "$Components_Server_Settings_BeforeContent" "Server/Settings/BeforeContent.tsx" REMOVE_REACT "$Components_Server_Settings_AfterContent" "Server/Settings/AfterContent.tsx" - # account REMOVE_REACT "$Components_Account_Overview_BeforeContent" "Account/Overview/BeforeContent.tsx" REMOVE_REACT "$Components_Account_Overview_AfterContent" "Account/Overview/AfterContent.tsx" diff --git a/resources/scripts/blueprint/components/Authentication/Container/AfterContent.tsx b/resources/scripts/blueprint/components/Authentication/Container/AfterContent.tsx new file mode 100644 index 0000000..5c85b6c --- /dev/null +++ b/resources/scripts/blueprint/components/Authentication/Container/AfterContent.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +/* blueprint/import */ + +export default () => { + return ( + <> + {/* blueprint/react */} + + ); +}; diff --git a/resources/scripts/blueprint/components/Authentication/Container/BeforeContent.tsx b/resources/scripts/blueprint/components/Authentication/Container/BeforeContent.tsx new file mode 100644 index 0000000..5c85b6c --- /dev/null +++ b/resources/scripts/blueprint/components/Authentication/Container/BeforeContent.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +/* blueprint/import */ + +export default () => { + return ( + <> + {/* blueprint/react */} + + ); +}; diff --git a/resources/scripts/components/auth/LoginFormContainer.tsx b/resources/scripts/components/auth/LoginFormContainer.tsx new file mode 100644 index 0000000..a64f6cc --- /dev/null +++ b/resources/scripts/components/auth/LoginFormContainer.tsx @@ -0,0 +1,60 @@ +import React, { forwardRef } from 'react'; +import { Form } from 'formik'; +import styled from 'styled-components/macro'; +import { breakpoint } from '@/theme'; +import FlashMessageRender from '@/components/FlashMessageRender'; +import tw from 'twin.macro'; + +import BeforeContent from '@/blueprint/components/Authentication/Container/BeforeContent'; +import AfterContent from '@/blueprint/components/Authentication/Container/AfterContent'; + +type Props = React.DetailedHTMLProps, HTMLFormElement> & { + title?: string; +}; + +const Container = styled.div` + ${breakpoint('sm')` + ${tw`w-4/5 mx-auto`} + `}; + + ${breakpoint('md')` + ${tw`p-10`} + `}; + + ${breakpoint('lg')` + ${tw`w-3/5`} + `}; + + ${breakpoint('xl')` + ${tw`w-full`} + max-width: 700px; + `}; +`; + +export default forwardRef(({ title, ...props }, ref) => ( + + {title &&

{title}

} + + +
+
+
+ +
+
{props.children}
+
+
+ +

+ © 2015 - {new Date().getFullYear()}  + + Pterodactyl Software + +

+
+));