@canmingir/link 1.2.24 → 1.2.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canmingir/link",
3
- "version": "1.2.24",
3
+ "version": "1.2.25",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -28,7 +28,7 @@ export default function AuthModernLayout({ image }) {
28
28
  <Logo
29
29
  maxSize={140}
30
30
  sx={{
31
- mb: { xs: 1, md: 2 },
31
+ mb: 1,
32
32
  width: 80,
33
33
  height: 80,
34
34
  }}
@@ -37,7 +37,7 @@ export default function AuthModernLayout({ image }) {
37
37
  <Card
38
38
  sx={{
39
39
  width: 1,
40
- py: { xs: 6, md: 8 },
40
+ py: { xs: 6, md: 4 },
41
41
  px: { xs: 4, md: 6 },
42
42
  boxShadow: {
43
43
  xs: (theme) =>
@@ -30,20 +30,11 @@ function LoginPage() {
30
30
  // eslint-disable-next-line react-hooks/exhaustive-deps
31
31
  }, [navigate]);
32
32
 
33
- if (credentials?.provider === "COGNITO") {
34
- return <CognitoLogin />;
35
- }
36
-
37
- if (credentials?.provider === "DEMO") {
38
- return (
39
- <Page title={`Sign in to ${name}`}>
40
- <DemoLogin />
41
- </Page>
42
- );
43
- }
44
-
45
33
  return (
46
34
  <Page title={`Sign in to ${name}`}>
35
+ {credentials?.provider === "COGNITO" && <CognitoLogin />}
36
+ {credentials?.provider === "DEMO" && <DemoLogin />}
37
+
47
38
  <LoginForm icon={template.login.icon} name={name} formColor={formColor} />
48
39
  </Page>
49
40
  );
@@ -158,8 +158,8 @@ export default function CognitoLogin() {
158
158
  );
159
159
 
160
160
  return (
161
- <Stack spacing={3}>
162
- <Box sx={{ mb: 1, textAlign: "center" }}>
161
+ <Stack spacing={3} sx={{ mb: 2 }}>
162
+ <Box sx={{ textAlign: "center" }}>
163
163
  <Box
164
164
  sx={{
165
165
  width: 52,
@@ -55,7 +55,7 @@ export default function DemoLogin() {
55
55
  }
56
56
 
57
57
  return (
58
- <Stack spacing={2.5}>
58
+ <Stack spacing={2.5} sx={{ mb: 2 }}>
59
59
  <Stack spacing={2}>
60
60
  <TextField
61
61
  label="Username"
@@ -18,12 +18,17 @@ const handleOAuthLogin = (
18
18
  };
19
19
 
20
20
  function LoginForm() {
21
- const { name, project } = config();
21
+ const { name, project, credentials } = config();
22
22
 
23
23
  const [email, setEmail] = useState("");
24
24
  const [password, setPassword] = useState("");
25
25
 
26
- const renderHead = (
26
+ const providerCheck =
27
+ credentials?.provider === "COGNITO" || credentials?.provider === "DEMO";
28
+
29
+ const hasContent = !providerCheck || !!project.nucleoid;
30
+
31
+ const renderHead = hasContent ? (
27
32
  <Stack spacing={2} sx={{ mb: 5 }}>
28
33
  <Typography variant="h4">Sign in to {name}</Typography>
29
34
  {project.nucleoid && (
@@ -34,7 +39,7 @@ function LoginForm() {
34
39
  </Stack>
35
40
  )}
36
41
  </Stack>
37
- );
42
+ ) : null;
38
43
 
39
44
  const renderForm = (
40
45
  <>