Skip to content

Commit c8e301c

Browse files
committed
Removes more styles - just one CSS file now
1 parent 201bb56 commit c8e301c

File tree

6 files changed

+44
-60
lines changed

6 files changed

+44
-60
lines changed

example/next-storage/components/Account.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { useState, useEffect, ChangeEvent } from 'react'
22
import { supabase } from '../lib/api'
33
import UploadButton from '../components/UploadButton'
44
import Avatar from './Avatar'
5-
import styles from '../styles/Home.module.css'
65
import { AuthSession } from '../../../dist/main'
76
import { DEFAULT_AVATARS_BUCKET, Profile } from '../lib/constants'
87

@@ -122,8 +121,8 @@ export default function Account({ session }: { session: AuthSession }) {
122121
gap: 20,
123122
}}
124123
>
125-
<div className={styles.card}>
126-
<div className={styles.avatarContainer}>
124+
<div className="card">
125+
<div>
127126
<Avatar url={avatar} size={270} />
128127
</div>
129128
<UploadButton onUpload={uploadAvatar} />

example/next-storage/components/ProfileCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ export default function ProfileCard({ profile }: { profile: Profile }) {
55
return (
66
<div className="card">
77
<Avatar url={profile.avatar_url} size={50} />
8-
<p>{profile.id}</p>
9-
<p>{profile.username}</p>
8+
<p>Username: {profile.username}</p>
9+
<p>Website: {profile.website}</p>
1010
</div>
1111
)
1212
}

example/next-storage/pages/index.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { supabase } from '../lib/api'
33
import Auth from '../components/Auth'
44
import Account from '../components/Account'
55
import ProfileCard from '../components/ProfileCard'
6-
import styles from '../styles/Home.module.css'
76
import { AuthSession, Subscription, SupabaseRealtimePayload } from '../../../dist/main'
87
import { Profile } from '../lib/constants'
98

@@ -51,17 +50,27 @@ export default function Home() {
5150
}
5251

5352
return (
54-
<div className={styles.container}>
53+
<div
54+
style={{
55+
minHeight: '100vh',
56+
display: 'flex',
57+
flexDirection: 'column',
58+
justifyContent: 'center',
59+
alignItems: 'center',
60+
}}
61+
>
5562
{!session ? (
5663
<Auth />
5764
) : (
58-
<div style={{ display: 'flex', gap: 20 }}>
59-
<div>
65+
<div style={{ display: 'flex', gap: 20, width: '50%' }}>
66+
<div className="flex flex-1">
6067
<Account key={session.user.id} session={session} />
6168
</div>
62-
<div>
69+
<div className="flex flex-1">
6370
{profiles?.map((profile) => (
64-
<ProfileCard profile={profile} key={profile.id} />
71+
<div key={profile.id}>
72+
<ProfileCard profile={profile} />
73+
</div>
6574
))}
6675
</div>
6776
</div>

example/next-storage/styles/Auth.module.css

Lines changed: 0 additions & 22 deletions
This file was deleted.

example/next-storage/styles/Home.module.css

Lines changed: 0 additions & 23 deletions
This file was deleted.

example/next-storage/styles/globals.css

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,30 @@ input[disabled] {
4747
color: var(--custom-color-secondary);
4848
}
4949

50+
/* Utils */
51+
52+
.block {
53+
display: block;
54+
width: 100%;
55+
}
56+
.inline-block {
57+
display: inline-block;
58+
width: 100%;
59+
}
60+
61+
.flex {
62+
display: flex;
63+
}
64+
.flex.column {
65+
flex: column;
66+
}
67+
.flex.row {
68+
flex: row;
69+
}
70+
.flex.flex-1 {
71+
flex: 1 1 0;
72+
}
73+
5074
/* Button */
5175

5276
button {
@@ -62,17 +86,14 @@ button {
6286
text-transform: uppercase;
6387
}
6488

65-
button.block {
66-
width: 100%;
67-
}
68-
6989
button.primary {
7090
background-color: var(--custom-color-brand);
7191
}
7292

7393
/* Widgets */
7494

7595
.card {
96+
width: 100%;
7697
border: var(--custom-border);
7798
border-radius: var(--custom-border-radius);
7899
padding: var(--custom-spacing);

0 commit comments

Comments
 (0)