Skip to content

Commit

Permalink
some styling applied; moved out sign in and sign up UI related action…
Browse files Browse the repository at this point in the history
…s from implementation to platform itself and used callback to handle it
  • Loading branch information
vygandas committed Dec 24, 2023
1 parent 5ab21f4 commit b582cac
Show file tree
Hide file tree
Showing 13 changed files with 559 additions and 91 deletions.
201 changes: 201 additions & 0 deletions apps/platform/src/components/common/logo.component.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
export const LogoComponent = () => (
<svg viewBox="0 0 552 133" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
fillRule="evenodd"
clipRule="evenodd"
d="M66.7497 132.776C103.353 132.776 133.026 103.103 133.026 66.5C133.026 29.8968 103.353 0.22406 66.7497 0.22406C30.1466 0.22406 0.473816 29.8968 0.473816 66.5C0.473816 103.103 30.1466 132.776 66.7497 132.776ZM66.7497 122.326C97.5814 122.326 122.575 97.3317 122.575 66.5C122.575 35.6683 97.5814 10.6742 66.7497 10.6742C35.918 10.6742 10.9239 35.6683 10.9239 66.5C10.9239 97.3317 35.918 122.326 66.7497 122.326Z"
fill="url(#paint0_linear_0_1)"
/>
<path
d="M66.1324 98.612L58.9314 92.4643C56.3311 95.963 47.8299 99.6616 43.6294 96.8127C37.2079 92.4575 42.9293 81.9682 46.3297 77.6198C49.1301 78.7694 55.631 81.7882 59.2315 84.6672C62.832 87.5461 68.8328 93.8638 71.3831 96.6627C79.3042 104.1 87.5853 105.36 95.0863 104.01C105.438 101.611 109.788 89.6153 105.588 80.3188C102.56 73.6171 96.7365 68.7731 92.3859 65.3243C88.0353 61.8756 77.6839 56.7775 74.8336 54.9782C72.5533 53.5387 68.2827 49.4802 66.4324 47.6309C62.6819 44.482 46.7098 23.4898 31.6278 36.535C19.1461 47.331 29.0274 62.5254 35.5283 68.7731L41.5291 61.2758L37.6286 56.7775C35.4783 54.1285 32.6479 47.8708 38.5287 44.0322C44.4095 40.1936 51.4804 44.8319 54.2808 47.6309C58.3314 51.2295 64.0321 57.2273 71.0831 63.2251C72.7333 64.6288 81.2844 68.7731 83.5347 69.9726C85.785 71.1722 90.2856 74.4709 91.9359 76.2703C93.5861 78.0696 101.987 85.8667 95.6864 92.6142C90.6457 98.0122 81.3844 93.264 77.3839 90.2151C75.1036 88.4158 67.7826 80.3188 63.7321 76.8701C57.5813 72.3717 44.4695 65.5642 43.6294 65.9241C42.7893 66.284 38.7787 72.9715 36.8785 76.2703C33.028 82.1681 27.7873 96.063 37.6286 104.46C47.4699 112.857 60.7317 104.06 66.1324 98.612Z"
fill="url(#paint1_linear_0_1)"
/>
<path
d="M72.3655 47.8557L65.9247 41.1006C71.5666 35.7466 82.8505 24.7383 95.7321 33.8952C105.926 41.1412 100.425 55.8617 96.3312 62.4167L87.7934 58.0634C90.5894 54.2605 94.8633 45.634 89.5909 41.5509C84.3184 37.4679 75.9104 44.0528 72.3655 47.8557Z"
fill="url(#paint2_linear_0_1)"
/>
<circle
cx="64.6184"
cy="24.2599"
r="7.35635"
fill="url(#paint3_linear_0_1)"
/>
<ellipse
cx="55.9558"
cy="61.7291"
rx="5.56883"
ry="5.50008"
fill="url(#paint4_linear_0_1)"
/>
<circle
cx="76.9936"
cy="77.8856"
r="5.56883"
fill="url(#paint5_linear_0_1)"
/>
<circle
cx="69.8435"
cy="111.299"
r="7.35635"
fill="url(#paint6_linear_0_1)"
/>
<circle
cx="23.2304"
cy="73.7605"
r="7.35635"
fill="url(#paint7_linear_0_1)"
/>
<circle
cx="110.269"
cy="62.0728"
r="7.35635"
fill="url(#paint8_linear_0_1)"
/>
<path
d="M165.569 105.512V47.8034H180.784V105.512H165.569Z"
fill="#444444"
/>
<path
d="M188.888 67.8005V62.8012C188.888 52.4404 193.887 47.26 203.885 47.26C221.057 47.26 231.345 48.2381 234.75 50.1944V59.7582H208.559C207.617 59.7582 206.82 59.8306 206.168 59.9755C205.588 60.1204 205.153 60.374 204.863 60.7363C204.574 61.0986 204.356 61.497 204.211 61.9318C204.139 62.3665 204.103 62.9823 204.103 63.7793V66.3876C204.103 68.0541 204.465 69.1046 205.19 69.5393C205.914 69.9016 207.037 70.0827 208.559 70.0827H222.252C224.933 70.0827 227.251 70.4812 229.208 71.2782C231.236 72.0027 232.83 73.0533 233.99 74.4299C235.221 75.8065 236.127 77.4005 236.707 79.2118C237.286 80.9507 237.576 82.8707 237.576 84.9719V90.9492C237.576 99.6436 233.917 104.607 226.599 105.838C225.585 105.983 224.535 106.056 223.448 106.056C205.19 106.056 194.466 105.005 191.279 102.904V93.4489H218.557C221.093 93.4489 222.361 92.2172 222.361 89.7538V87.0368C222.361 86.1673 222.252 85.479 222.035 84.9719C221.89 84.4647 221.528 84.0662 220.948 83.7764C220.368 83.4866 219.571 83.3417 218.557 83.3417H205.081C199.792 83.3417 195.771 82.11 193.017 79.6466C190.264 77.1831 188.888 73.2345 188.888 67.8005Z"
fill="#444444"
/>
<path
d="M244.837 77.473C244.837 71.5318 245.272 66.6412 246.141 62.8012C247.011 58.9612 248.532 55.8819 250.706 53.5634C252.88 51.2449 255.56 49.6147 258.748 48.6728C262.009 47.731 266.138 47.26 271.138 47.26C281.064 47.26 287.911 49.4336 291.678 53.7808C295.518 58.128 297.438 66.0254 297.438 77.473C297.438 88.2685 295.554 95.7311 291.787 99.861C288.092 103.991 281.209 106.056 271.138 106.056C267.153 106.056 263.675 105.73 260.704 105.078C257.806 104.353 255.307 103.302 253.206 101.926C251.177 100.549 249.547 98.7379 248.315 96.4919C247.083 94.1734 246.178 91.4926 245.598 88.4496C245.091 85.3341 244.837 81.6752 244.837 77.473ZM260.052 77.473C260.052 81.1681 260.234 84.1024 260.596 86.276C260.958 88.4496 261.61 90.116 262.552 91.2753C263.566 92.3621 264.689 93.0504 265.921 93.3402C267.153 93.63 268.892 93.7749 271.138 93.7749C273.094 93.7749 274.579 93.7025 275.594 93.5575C276.68 93.4126 277.695 93.0504 278.637 92.4708C279.651 91.8911 280.375 90.9855 280.81 89.7538C281.317 88.5221 281.68 86.9643 281.897 85.0805C282.114 83.1243 282.223 80.5884 282.223 77.473C282.223 74.1401 282.114 71.4594 281.897 69.4307C281.752 67.3295 281.462 65.5906 281.028 64.214C280.593 62.765 279.905 61.7506 278.963 61.171C278.021 60.5189 276.97 60.0842 275.811 59.8669C274.652 59.577 273.094 59.4321 271.138 59.4321C269.544 59.4321 268.24 59.5046 267.225 59.6495C266.211 59.7944 265.233 60.1204 264.291 60.6276C263.349 61.0623 262.624 61.6782 262.117 62.4752C261.683 63.1997 261.284 64.2503 260.922 65.6269C260.56 67.0035 260.306 68.6337 260.161 70.5175C260.089 72.4012 260.052 74.7197 260.052 77.473Z"
fill="#444444"
/>
<path
d="M306.521 105.512V47.8034H318.693L321.736 53.9981C321.953 53.8532 322.243 53.6359 322.605 53.3461C324.199 52.2593 325.395 51.4623 326.192 50.9551C327.061 50.3755 328.22 49.7234 329.669 48.9989C331.191 48.2744 332.749 47.7672 334.343 47.4774C335.937 47.1151 337.712 46.934 339.668 46.934C347.131 46.934 352.13 49.4336 354.666 54.4329C361.476 49.4336 368.396 46.934 375.424 46.934C386.871 46.934 392.595 53.7083 392.595 67.2571V105.512H377.38V67.0397C377.38 64.4314 376.8 62.4752 375.641 61.171C374.554 59.8669 372.996 59.2148 370.968 59.2148C370.026 59.2148 369.12 59.251 368.251 59.3235C367.381 59.3959 366.512 59.5046 365.642 59.6495C364.845 59.7944 364.048 59.9755 363.251 60.1929C362.527 60.4102 361.802 60.7001 361.078 61.0623C360.353 61.3521 359.629 61.7506 358.904 62.2578C358.252 62.6925 357.564 63.1997 356.839 63.7793C356.839 63.8518 356.839 64.0691 356.839 64.4314C356.912 64.7212 356.948 65.0472 356.948 65.4095C356.948 65.7718 356.948 66.134 356.948 66.4963C356.948 66.8586 356.948 67.0759 356.948 67.1484V105.512H341.733V67.0397C341.733 65.7356 341.588 64.5763 341.298 63.562C341.008 62.5476 340.574 61.7506 339.994 61.171C339.414 60.5189 338.726 60.048 337.929 59.7582C337.132 59.3959 336.263 59.2148 335.321 59.2148C333.364 59.2148 331.626 59.3959 330.104 59.7582C328.583 60.1204 327.206 60.6638 325.974 61.3884C324.743 62.0404 323.33 62.9461 321.736 64.1054V105.512H306.521Z"
fill="#444444"
/>
<path
d="M400.746 76.3862C400.746 71.3869 401.036 67.2208 401.615 63.888C402.267 60.4827 403.173 57.6933 404.332 55.5197C405.492 53.2736 407.122 51.571 409.223 50.4117C411.324 49.2525 413.643 48.4555 416.178 48.0208C418.787 47.586 422.047 47.3687 425.96 47.3687C428.568 47.3687 430.778 47.4411 432.589 47.586C434.4 47.6585 436.212 47.8759 438.023 48.2381C439.907 48.5279 441.428 48.9989 442.588 49.651C443.747 50.2306 444.87 51.0638 445.957 52.1506C447.043 53.1649 447.877 54.4329 448.456 55.9544C449.108 57.4034 449.579 59.1785 449.869 61.2797C450.231 63.3084 450.412 65.6631 450.412 68.3439C450.412 73.4156 449.072 77.1107 446.391 79.4292C443.711 81.7477 439.689 82.9069 434.328 82.9069H415.961C415.961 86.2398 416.432 88.7394 417.374 90.4058C418.388 91.9998 419.62 92.9779 421.069 93.3402C422.59 93.7025 424.945 93.8836 428.133 93.8836C437.045 93.8836 444.109 93.4851 449.326 92.6881V103.013C443.892 105.041 434.038 106.056 419.765 106.056C416.07 106.056 412.99 105.512 410.527 104.426C408.136 103.339 406.216 101.564 404.767 99.1002C403.318 96.6368 402.267 93.5938 401.615 89.9711C401.036 86.3485 400.746 81.8201 400.746 76.3862ZM415.961 71.9303H430.415C433.603 71.9303 435.197 70.4812 435.197 67.5831C435.197 63.9605 434.69 61.642 433.676 60.6276C432.734 59.5408 430.452 58.9974 426.829 58.9974C424.51 58.9974 422.772 59.1061 421.612 59.3235C420.526 59.4684 419.439 59.9755 418.352 60.845C417.338 61.642 416.649 62.9099 416.287 64.6488C415.997 66.3876 415.889 68.8148 415.961 71.9303Z"
fill="#444444"
/>
<path
d="M458.715 105.512V47.8034H471.539L473.93 55.0849C479.364 49.8683 484.87 47.26 490.449 47.26C493.565 47.26 495.702 47.4774 496.861 47.9121V62.5838C494.832 62.3665 492.043 62.2578 488.493 62.2578C485.088 62.2578 482.226 62.7287 479.907 63.6706C477.661 64.5401 475.669 66.2065 473.93 68.6699V105.512H458.715Z"
fill="#444444"
/>
<path
d="M502.403 90.8406V85.4066C502.403 83.1605 502.693 81.1318 503.272 79.3205C503.924 77.5092 504.903 75.8428 506.207 74.3213C507.511 72.7997 509.25 71.6405 511.423 70.8435C513.669 69.9741 516.314 69.5393 519.357 69.5393C522.183 69.5393 524.972 69.5756 527.725 69.648C530.551 69.648 533.413 69.6118 536.311 69.5393C536.383 67.1484 536.383 65.9167 536.311 65.8442C536.311 64.3227 536.13 63.091 535.768 62.1491C535.478 61.2072 534.971 60.4827 534.246 59.9755C533.522 59.4684 532.725 59.1423 531.855 58.9974C530.986 58.8525 529.899 58.7801 528.595 58.7801C523.885 58.7801 515.807 59.1785 504.359 59.9755V50.6291C510.808 48.0932 519.574 46.7891 530.66 46.7166C537.325 46.7166 542.47 48.1294 546.092 50.9551C549.715 53.7083 551.526 58.4902 551.526 65.3008V105.512H539.463L536.311 99.2089C536.021 99.7161 535.079 100.513 533.485 101.6C531.964 102.614 529.79 103.665 526.965 104.752C524.139 105.766 521.386 106.237 518.705 106.164C513.488 106.019 509.467 104.462 506.641 101.491C503.816 98.4481 502.403 94.8979 502.403 90.8406ZM517.618 88.667C517.618 90.8406 518.089 92.2896 519.031 93.0141C519.973 93.6662 521.313 93.9923 523.052 93.9923C523.922 93.9923 524.827 93.9198 525.769 93.7749C526.711 93.5576 527.58 93.3402 528.377 93.1228C529.247 92.833 530.08 92.5432 530.877 92.2534C531.674 91.8911 532.399 91.5651 533.051 91.2753C533.703 90.913 534.246 90.6232 534.681 90.4058C535.188 90.116 535.586 89.8987 535.876 89.7538C536.166 89.5364 536.311 89.4277 536.311 89.4277V78.8858L522.291 79.9726C521.349 80.045 520.552 80.2986 519.9 80.7333C519.248 81.0956 518.741 81.5666 518.379 82.1462C518.089 82.7258 517.872 83.3054 517.727 83.8851C517.654 84.4647 517.618 85.1168 517.618 85.8413V88.667Z"
fill="#444444"
/>
<path
d="M165.026 29.654V39.2178C165.026 39.725 165.134 40.1959 165.352 40.6306C165.569 40.9929 165.859 41.2827 166.221 41.5001C166.656 41.645 167.127 41.7174 167.634 41.7174H179.045C179.842 41.7174 180.422 41.5001 180.784 41.0653C181.219 40.6306 181.436 40.0148 181.436 39.2178V29.654C181.436 27.7702 180.639 26.8283 179.045 26.8283H167.634C165.895 26.8283 165.026 27.7702 165.026 29.654Z"
fill="url(#paint9_linear_0_1)"
/>
<defs>
<linearGradient
id="paint0_linear_0_1"
x1="66.7497"
y1="0.22406"
x2="66.7497"
y2="132.776"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#8CF7D1" />
<stop offset="0.5" stopColor="#36D7CC" />
<stop offset="1" stopColor="#067AD2" />
</linearGradient>
<linearGradient
id="paint1_linear_0_1"
x1="66.406"
y1="32.3037"
x2="66.406"
y2="107.93"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#4CE0B9" />
<stop offset="1" stopColor="#0C7FD5" />
<stop offset="1" stopColor="#D9D9D9" stopOpacity="0" />
</linearGradient>
<linearGradient
id="paint2_linear_0_1"
x1="83.7312"
y1="30.3787"
x2="83.7312"
y2="62.4167"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#5FFED2" />
<stop offset="1" stopColor="#1D967B" />
</linearGradient>
<linearGradient
id="paint3_linear_0_1"
x1="65.6693"
y1="19.6058"
x2="64.6184"
y2="31.6162"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="white" />
<stop offset="1" stopColor="#3DCAC0" />
</linearGradient>
<linearGradient
id="paint4_linear_0_1"
x1="56.7514"
y1="58.2494"
x2="55.9752"
y2="67.2308"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="white" />
<stop offset="1" stopColor="#2DB0C7" />
</linearGradient>
<linearGradient
id="paint5_linear_0_1"
x1="77.7892"
y1="74.3625"
x2="76.9936"
y2="83.4544"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="white" />
<stop offset="1" stopColor="#1C97CF" />
</linearGradient>
<linearGradient
id="paint6_linear_0_1"
x1="70.8944"
y1="106.645"
x2="69.8435"
y2="118.655"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="white" />
<stop offset="1" stopColor="#0778D4" />
</linearGradient>
<linearGradient
id="paint7_linear_0_1"
x1="24.2813"
y1="69.1065"
x2="23.2304"
y2="81.1169"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="white" />
<stop offset="1" stopColor="#2ABFD6" />
</linearGradient>
<linearGradient
id="paint8_linear_0_1"
x1="111.32"
y1="57.4188"
x2="110.269"
y2="69.4292"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="white" />
<stop offset="1" stopColor="#27A7CA" />
</linearGradient>
<linearGradient
id="paint9_linear_0_1"
x1="173.231"
y1="26.8283"
x2="173.231"
y2="41.7174"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#82F3D1" />
<stop offset="1" stopColor="#097FD2" />
</linearGradient>
</defs>
</svg>
)
63 changes: 63 additions & 0 deletions apps/platform/src/layouts/private.layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import React, { FC } from 'react'
import useSession from '../hooks/useSession'
import { Link, useNavigate } from 'react-router-dom'
import { toast } from 'react-toastify'
import { clearAuthState, pages, useLogoutPerformForm } from '@isomera/impl'
import { LogoComponent } from '../components/common/logo.component'

interface Props {
children: React.ReactNode | React.ReactNode[]
}

export const PrivateLayout: FC<Props> = ({ children }) => {
const { user, setUser } = useSession()
const navigate = useNavigate()

const onSuccess = (message: string) => {
toast.success(message)
setUser(undefined)
clearAuthState()
navigate(pages.login.path)
}

const onError = (message: string) => {
toast.error(message)
}

const { handleClick } = useLogoutPerformForm(onSuccess, onError)

return (
<>
<nav className="nav_top">
<ul className="nav_left">
<li className="nav_logo_wrapper">
<Link to={pages.dashboard.path}>
<LogoComponent />
</Link>
</li>
<li>
<Link to={pages.dashboard.path}>Home</Link>
</li>
<li>
<Link to={pages.userInfo.path}>Profile</Link>
</li>
</ul>
<div className="nav_right">
<span>
{user?.firstName} {user?.lastName}
</span>
<span>
<button
className="nav_logout_button"
type="button"
onClick={handleClick}
>
Logout
</button>
</span>
</div>
</nav>
<main>{children}</main>
</>
)
}
13 changes: 13 additions & 0 deletions apps/platform/src/layouts/public.layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React, { FC } from 'react'

interface Props {
children: React.ReactNode | React.ReactNode[]
}

export const PublicLayout: FC<Props> = ({ children }) => {
return (
<div className="public_layout">
<main>{children}</main>
</div>
)
}
2 changes: 1 addition & 1 deletion apps/platform/src/router/privateRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function PrivateRoute(props: Props) {
return <Navigate to={pages.login.path} />
}

return <div>{children}</div>
return <>{children}</>

Check warning on line 23 in apps/platform/src/router/privateRoute.tsx

View workflow job for this annotation

GitHub Actions / build (20.x)

Fragments should contain more than one child - otherwise, there’s no need for a Fragment at all
}

export default PrivateRoute
4 changes: 2 additions & 2 deletions apps/platform/src/router/publicRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ function PublicRoute(props: Props) {
const { isAuthenticated } = useSession()

if (isAuthenticated) {
return <Navigate to={pages.userInfo.path} />
return <Navigate to={pages.dashboard.path} />
}

return <div>{children}</div>
return <>{children}</>

Check warning on line 19 in apps/platform/src/router/publicRoute.tsx

View workflow job for this annotation

GitHub Actions / build (20.x)

Fragments should contain more than one child - otherwise, there’s no need for a Fragment at all
}

export default PublicRoute
Loading

2 comments on commit b582cac

@vercel
Copy link

@vercel vercel bot commented on b582cac Dec 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

isomera-platform – ./

isomera-platform-git-main-cortip.vercel.app
app.isomera.org
isomera.vercel.app
isomera-platform-cortip.vercel.app

@vercel
Copy link

@vercel vercel bot commented on b582cac Dec 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.