@snapdragonsnursery/react-components 1.0.8 → 1.0.10
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 +1 -1
- package/src/LandingPage.jsx +106 -15
package/package.json
CHANGED
package/src/LandingPage.jsx
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
//
|
|
3
3
|
// A reusable landing page component for Microsoft authentication
|
|
4
4
|
// Designed to work across different applications with customizable branding
|
|
5
|
+
// Uses inline styles and basic CSS for maximum compatibility
|
|
5
6
|
//
|
|
6
7
|
// Example usage:
|
|
7
8
|
// import LandingPage from './LandingPage';
|
|
@@ -30,7 +31,7 @@ const LandingPage = ({
|
|
|
30
31
|
appDescription = "Manage your application efficiently",
|
|
31
32
|
onSignIn,
|
|
32
33
|
companyName = "Your Company",
|
|
33
|
-
backgroundColor = "
|
|
34
|
+
backgroundColor = "linear-gradient(135deg, #EBF4FF 0%, #E6E6FA 100%)",
|
|
34
35
|
cardClassName = ""
|
|
35
36
|
}) => {
|
|
36
37
|
const handleSignInClick = () => {
|
|
@@ -41,34 +42,118 @@ const LandingPage = ({
|
|
|
41
42
|
}
|
|
42
43
|
};
|
|
43
44
|
|
|
45
|
+
const styles = {
|
|
46
|
+
container: {
|
|
47
|
+
minHeight: '100vh',
|
|
48
|
+
background: backgroundColor,
|
|
49
|
+
display: 'flex',
|
|
50
|
+
alignItems: 'center',
|
|
51
|
+
justifyContent: 'center',
|
|
52
|
+
padding: '1rem'
|
|
53
|
+
},
|
|
54
|
+
card: {
|
|
55
|
+
maxWidth: '28rem',
|
|
56
|
+
width: '100%',
|
|
57
|
+
backgroundColor: 'white',
|
|
58
|
+
borderRadius: '1rem',
|
|
59
|
+
boxShadow: '0 25px 50px -12px rgba(0, 0, 0, 0.25)',
|
|
60
|
+
padding: '2rem',
|
|
61
|
+
border: '1px solid #e5e7eb'
|
|
62
|
+
},
|
|
63
|
+
logoSection: {
|
|
64
|
+
textAlign: 'center',
|
|
65
|
+
marginBottom: '2rem'
|
|
66
|
+
},
|
|
67
|
+
logo: {
|
|
68
|
+
height: '4rem',
|
|
69
|
+
margin: '0 auto 1rem auto'
|
|
70
|
+
},
|
|
71
|
+
title: {
|
|
72
|
+
fontSize: '1.5rem',
|
|
73
|
+
fontWeight: 'bold',
|
|
74
|
+
color: '#111827',
|
|
75
|
+
marginBottom: '0.5rem'
|
|
76
|
+
},
|
|
77
|
+
description: {
|
|
78
|
+
color: '#6b7280'
|
|
79
|
+
},
|
|
80
|
+
content: {
|
|
81
|
+
display: 'flex',
|
|
82
|
+
flexDirection: 'column',
|
|
83
|
+
gap: '1.5rem'
|
|
84
|
+
},
|
|
85
|
+
welcomeSection: {
|
|
86
|
+
textAlign: 'center'
|
|
87
|
+
},
|
|
88
|
+
icon: {
|
|
89
|
+
height: '3rem',
|
|
90
|
+
width: '3rem',
|
|
91
|
+
color: '#2563eb',
|
|
92
|
+
margin: '0 auto 1rem auto'
|
|
93
|
+
},
|
|
94
|
+
welcomeTitle: {
|
|
95
|
+
fontSize: '1.25rem',
|
|
96
|
+
fontWeight: '600',
|
|
97
|
+
color: '#111827',
|
|
98
|
+
marginBottom: '0.5rem'
|
|
99
|
+
},
|
|
100
|
+
welcomeText: {
|
|
101
|
+
fontSize: '0.875rem',
|
|
102
|
+
color: '#6b7280'
|
|
103
|
+
},
|
|
104
|
+
button: {
|
|
105
|
+
width: '100%',
|
|
106
|
+
backgroundColor: '#2563eb',
|
|
107
|
+
color: 'white',
|
|
108
|
+
fontWeight: '500',
|
|
109
|
+
padding: '0.75rem 1rem',
|
|
110
|
+
borderRadius: '0.5rem',
|
|
111
|
+
border: 'none',
|
|
112
|
+
cursor: 'pointer',
|
|
113
|
+
display: 'flex',
|
|
114
|
+
alignItems: 'center',
|
|
115
|
+
justifyContent: 'center',
|
|
116
|
+
gap: '0.5rem',
|
|
117
|
+
transition: 'background-color 0.2s'
|
|
118
|
+
},
|
|
119
|
+
buttonHover: {
|
|
120
|
+
backgroundColor: '#1d4ed8'
|
|
121
|
+
},
|
|
122
|
+
footer: {
|
|
123
|
+
textAlign: 'center',
|
|
124
|
+
fontSize: '0.75rem',
|
|
125
|
+
color: '#6b7280'
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
|
|
44
129
|
return (
|
|
45
|
-
<div
|
|
46
|
-
<div
|
|
130
|
+
<div style={styles.container}>
|
|
131
|
+
<div style={styles.card} className={cardClassName}>
|
|
47
132
|
{/* Logo Section */}
|
|
48
|
-
<div
|
|
133
|
+
<div style={styles.logoSection}>
|
|
49
134
|
<img
|
|
50
135
|
src={logoUrl}
|
|
51
136
|
alt={`${companyName} Logo`}
|
|
52
|
-
|
|
137
|
+
style={styles.logo}
|
|
53
138
|
/>
|
|
54
|
-
<h1
|
|
139
|
+
<h1 style={styles.title}>
|
|
55
140
|
{appName}
|
|
56
141
|
</h1>
|
|
57
|
-
<p
|
|
142
|
+
<p style={styles.description}>
|
|
58
143
|
{appDescription}
|
|
59
144
|
</p>
|
|
60
145
|
</div>
|
|
61
146
|
|
|
62
147
|
{/* Sign In Section */}
|
|
63
|
-
<div
|
|
64
|
-
<div
|
|
65
|
-
<svg
|
|
148
|
+
<div style={styles.content}>
|
|
149
|
+
<div style={styles.welcomeSection}>
|
|
150
|
+
<svg style={styles.icon} fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
66
151
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" />
|
|
67
152
|
</svg>
|
|
68
|
-
<h2
|
|
153
|
+
<h2 style={styles.welcomeTitle}>
|
|
69
154
|
Welcome Back
|
|
70
155
|
</h2>
|
|
71
|
-
<p
|
|
156
|
+
<p style={styles.welcomeText}>
|
|
72
157
|
Sign in with your Microsoft account to access the system
|
|
73
158
|
</p>
|
|
74
159
|
</div>
|
|
@@ -76,10 +161,16 @@ const LandingPage = ({
|
|
|
76
161
|
{/* Microsoft Sign In Button */}
|
|
77
162
|
<button
|
|
78
163
|
onClick={handleSignInClick}
|
|
79
|
-
|
|
164
|
+
style={styles.button}
|
|
165
|
+
onMouseEnter={(e) => {
|
|
166
|
+
e.target.style.backgroundColor = styles.buttonHover.backgroundColor;
|
|
167
|
+
}}
|
|
168
|
+
onMouseLeave={(e) => {
|
|
169
|
+
e.target.style.backgroundColor = styles.button.backgroundColor;
|
|
170
|
+
}}
|
|
80
171
|
>
|
|
81
172
|
{/* Official Microsoft logo SVG */}
|
|
82
|
-
<svg
|
|
173
|
+
<svg style={{width: '1.25rem', height: '1.25rem'}} viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
83
174
|
<rect x="2" y="2" width="9" height="9" fill="#F35325"/>
|
|
84
175
|
<rect x="13" y="2" width="9" height="9" fill="#81BC06"/>
|
|
85
176
|
<rect x="2" y="13" width="9" height="9" fill="#05A6F0"/>
|
|
@@ -89,7 +180,7 @@ const LandingPage = ({
|
|
|
89
180
|
</button>
|
|
90
181
|
|
|
91
182
|
{/* Additional Info */}
|
|
92
|
-
<div
|
|
183
|
+
<div style={styles.footer}>
|
|
93
184
|
<p>This application is for {companyName} employees only</p>
|
|
94
185
|
</div>
|
|
95
186
|
</div>
|