Skip to content

Commit a8dde05

Browse files
committed
feat(sdks): upgrade React UI, fix error parsing, and bump versions
- refactor(@urbackend/react): overhaul UI for UrAuth, UrUserButton, and Toast to a premium, minimalistic design (no animations). - fix(@urbackend/sdk): correct parseApiError logic to prioritize specific 'message' fields over generic 'error' strings (fixes soft-deletion warning masking). - chore(react-sdk-demo): replace text-based loading fallback with a modern CSS spinner in App.tsx. - chore(sdks): bump @urbackend/sdk to 0.4.4 and @urbackend/react to 0.2.3.
1 parent c3eb4c8 commit a8dde05

13 files changed

Lines changed: 451 additions & 536 deletions

File tree

examples/react-sdk-demo/src/App.tsx

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,22 @@ function App() {
1919
};
2020

2121
const LoadingFallback = (
22-
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100vh', color: '#64748b', background: '#f8fafc' }}>
23-
Loading urBackend...
22+
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100vh', background: '#fafafa' }}>
23+
<div style={{
24+
width: '24px',
25+
height: '24px',
26+
border: '2px solid #e4e4e7',
27+
borderTopColor: '#09090b',
28+
borderRadius: '50%',
29+
animation: 'spin 1s linear infinite'
30+
}} />
31+
<style>
32+
{`
33+
@keyframes spin {
34+
to { transform: rotate(360deg); }
35+
}
36+
`}
37+
</style>
2438
</div>
2539
);
2640

@@ -74,18 +88,18 @@ function Dashboard() {
7488
width: '100%',
7589
maxWidth: '500px',
7690
background: '#ffffff',
77-
borderRadius: '0',
91+
borderRadius: '16px',
7892
padding: '40px',
79-
boxShadow: '0 20px 40px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.05)',
80-
border: '1px solid #e2e8f0',
81-
fontFamily: 'system-ui, -apple-system, sans-serif'
93+
boxShadow: '0 1px 3px rgba(0,0,0,0.05), 0 20px 40px -12px rgba(0,0,0,0.1)',
94+
border: '1px solid #e4e4e7',
95+
fontFamily: 'system-ui, -apple-system, "Helvetica Neue", sans-serif'
8296
}}>
8397

8498
<div style={{ display: 'flex', alignItems: 'center', gap: '16px', marginBottom: '32px' }}>
8599
{typeof user?.avatarUrl === 'string' && user?.avatarUrl ? (
86-
<img src={user.avatarUrl } alt="Avatar" style={{ width: '64px', height: '64px', borderRadius: '0', objectFit: 'cover' }} />
100+
<img src={user.avatarUrl } alt="Avatar" style={{ width: '64px', height: '64px', borderRadius: '12px', objectFit: 'cover', border: '1px solid #e4e4e7' }} />
87101
) : (
88-
<div style={{ width: '64px', height: '64px', borderRadius: '0', background: 'linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%)', display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: '24px', fontWeight: 600, color: '#64748b' }}>
102+
<div style={{ width: '64px', height: '64px', borderRadius: '12px', background: '#f4f4f5', display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: '24px', fontWeight: 600, color: '#71717a', border: '1px solid #e4e4e7' }}>
89103
{user?.name?.[0]?.toUpperCase() || user?.email?.[0]?.toUpperCase()}
90104
</div>
91105
)}
@@ -95,8 +109,8 @@ function Dashboard() {
95109
</div>
96110
</div>
97111

98-
<div style={{ background: '#f8fafc', borderRadius: '0', padding: '20px', border: '1px solid #e2e8f0', marginBottom: '32px' }}>
99-
<h3 style={{ margin: '0 0 16px', fontSize: '13px', textTransform: 'uppercase', letterSpacing: '1px', color: '#94a3b8', fontWeight: 600 }}>Your Profile</h3>
112+
<div style={{ background: '#fafafa', borderRadius: '12px', padding: '20px', border: '1px solid #e4e4e7', marginBottom: '32px' }}>
113+
<h3 style={{ margin: '0 0 16px', fontSize: '13px', textTransform: 'uppercase', letterSpacing: '1px', color: '#a1a1aa', fontWeight: 600 }}>Your Profile</h3>
100114

101115
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '12px', fontSize: '14px' }}>
102116
<span style={{ color: '#64748b' }}>Email</span>
@@ -118,20 +132,16 @@ function Dashboard() {
118132
onClick={logout}
119133
style={{
120134
width: '100%',
121-
padding: '14px',
122-
borderRadius: '0',
123-
background: 'linear-gradient(180deg, #2a2a2a 0%, #111111 100%)',
135+
padding: '12px 14px',
136+
borderRadius: '8px',
137+
background: '#09090b',
124138
color: '#ffffff',
125-
fontSize: '15px',
126-
fontWeight: 600,
139+
fontSize: '14px',
140+
fontWeight: 500,
127141
border: 'none',
128-
boxShadow: '0 4px 12px rgba(0,0,0,0.15)',
129-
cursor: 'pointer',
130-
transition: 'transform 0.1s ease'
142+
boxShadow: '0 1px 2px rgba(0,0,0,0.05)',
143+
cursor: 'pointer'
131144
}}
132-
onMouseDown={e => e.currentTarget.style.transform = 'scale(0.98)'}
133-
onMouseUp={e => e.currentTarget.style.transform = 'scale(1)'}
134-
onMouseLeave={e => e.currentTarget.style.transform = 'scale(1)'}
135145
>
136146
Sign Out
137147
</button>

package-lock.json

Lines changed: 29 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)