Skip to content

Commit

Permalink
added missing pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Ark2307 committed Mar 20, 2024
1 parent 1dfae79 commit 4dcc0bc
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 0 deletions.
13 changes: 13 additions & 0 deletions apps/dashboard/web/polaris_web/web/public/email_icon_big.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions apps/dashboard/web/polaris_web/web/src/apps/main/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ import TestLibrary from "../dashboard/pages/settings/test_library/TestLibrary";
import { useStiggContext } from '@stigg/react-sdk';
import DependencyTable from "../dashboard/pages/testing/DependencyTable/DependencyTable";
import SignupPage from "../signup/pages/SignupPage";
import PageCheckInbox from "../signup/pages/PageCheckInbox"
import PageBusinessEmail from "../signup/pages/PageBusinessEmail"

// if you add a component in a new path, please verify the search implementation in function -> 'getSearchItemsArr' in func.js

Expand Down Expand Up @@ -296,6 +298,14 @@ const router = createBrowserRouter([
path: "/signup",
element: <SignupPage />,
},
{
path: "/check-inbox",
element: <PageCheckInbox />
},
{
path: "/business-email",
element: <PageBusinessEmail />
}
])

function App() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import React from 'react'
import { Avatar, Box, Button, HorizontalStack, Page, Text, VerticalStack } from '@shopify/polaris'
import { useSearchParams } from 'react-router-dom'
import "../styles.css"
import axios from 'axios'

function Auth0Redirects({bodyText, errorText}) {
const [searchParams, setSearchParams] = useSearchParams();
const state = searchParams.get("state")
const handleLogout = () => {

if(state){
let url = "/addUserToAccount?state=" + state;
axios.post("/auth0-logout", {"redirectUrl": url}).then((resp) => {
if(resp.data.logoutUrl){
window.location.href = resp.data.logoutUrl;
return;
}
window.location.href = "/login"
});
} else {
axios.get("/auth0-logout").then((resp) => {
if(resp.data.logoutUrl){
window.location.href = resp.data.logoutUrl;
return;
}
window.location.href = "/login"
});
}
}

return (
<Page fullWidth>
<Box padding={"20"} paddingBlockEnd={"0"}>
<HorizontalStack align='center'>
<Box width='400px'>
<VerticalStack gap={"8"}>
<HorizontalStack align="center">
<div className="akto-logo">
<Avatar source="/public/akto_name_with_logo.svg" shape="round" size="2xl-experimental" />
</div>
</HorizontalStack>
<VerticalStack gap={"6"}>
<HorizontalStack align='center'>
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="65" viewBox="0 0 64 65" fill="none">
<g clipPath="url(#clip0_7639_55607)">
<path d="M0 17.4927V50.0545C0 52.7055 2.14903 54.8545 4.8 54.8545H59.2C61.851 54.8545 64 52.7055 64 50.0545V17.4924L33.6121 35.2187C32.6158 35.7999 31.3837 35.7999 30.3874 35.2187L0 17.4927Z" fill="#5C5F62"/>
<path d="M62.2186 11.1223C61.394 10.4545 60.3437 10.0545 59.2 10.0545H4.8C3.6562 10.0545 2.60584 10.4546 1.78122 11.1224L31.9997 28.7499L62.2186 11.1223Z" fill="#5C5F62"/>
</g>
<defs>
<clipPath id="clip0_7639_55607">
<rect width="64" height="64" fill="white" transform="translate(0 0.454529)"/>
</clipPath>
</defs>
</svg>
</HorizontalStack>
<VerticalStack gap={"2"}>
<Text alignment="center" variant="headingLg">{errorText}</Text>
<Text alignment="center" variant="bodyMd" color="subdued">{bodyText}</Text>
</VerticalStack>
</VerticalStack>
<Button fullWidth onClick={handleLogout}>
Redirect to login
</Button>
</VerticalStack>
</Box>
</HorizontalStack>
<div style={{position: 'absolute' , bottom: '3vh', width: '84%'}}>
<HorizontalStack gap={3} align="center">
<Button plain onClick={() => window.open("https://www.akto.io/terms-and-policies","_blank")}>Terms of use</Button>
<div style={{width: '1px', height: '24px', background: "#E1E3E5"}} />
<Button plain onClick={() => window.open("https://www.akto.io/terms/privacy","_blank")}>Privacy policy</Button>
</HorizontalStack>
</div>
</Box>
</Page>
)
}

export default Auth0Redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react'
import Auth0Redirects from '../components/Auth0Redirects'

function PageBusinessEmail() {
return (
<Auth0Redirects
errorText={"Please sign up with a business email only"}
bodyText={"Try again with a different email id"}
/>
)
}

export default PageBusinessEmail
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react'
import Auth0Redirects from '../components/Auth0Redirects'

function PageCheckInbox() {
return (
<Auth0Redirects
errorText={"Please sign up with a business email only"}
bodyText={"Try again with a different email id"}
/>
)
}

export default PageCheckInbox

0 comments on commit 4dcc0bc

Please sign in to comment.