Skip to content

Commit 821d280

Browse files
committed
Refresh profile pics and make them square
1 parent 1da487a commit 821d280

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

web/components/profile-carousel.tsx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ import {PlusIcon} from '@heroicons/react/solid'
1515
import {EditablePhotoGrid} from './widgets/editable-photo-grid'
1616
import {AddPhotosWidget} from './widgets/add-photos'
1717

18-
export default function ProfileCarousel(props: { profile: Profile }) {
19-
const {profile} = props
18+
export default function ProfileCarousel(props: {
19+
profile: Profile,
20+
refreshProfile: () => void,
21+
}) {
22+
const {profile, refreshProfile} = props
2023
const photoNums = profile.photo_urls ? profile.photo_urls.length : 0
2124

2225
const [lightboxUrl, setLightboxUrl] = useState('')
@@ -36,27 +39,28 @@ export default function ProfileCarousel(props: { profile: Profile }) {
3639
photo_urls: photoUrls,
3740
})
3841
setIsEditMode(false)
42+
refreshProfile()
3943
}
4044

4145
if (!currentUser && profile.visibility !== 'public') {
4246
return (
4347
<Carousel>
4448
{profile.pinned_url && (
45-
<div className="h-80 w-[250px] flex-none snap-start">
49+
<div className="h-[300px] w-[300px] flex-none snap-start">
4650
<Image
4751
priority={true}
4852
src={profile.pinned_url}
49-
height={360}
50-
width={240}
51-
sizes="(max-width: 640px) 100vw, 240px"
53+
height={300}
54+
width={300}
55+
sizes="(max-width: 640px) 100vw, 300px"
5256
alt=""
5357
className="h-full cursor-pointer rounded object-cover"
5458
/>
5559
</div>
5660
)}
5761
{photoNums > 0 && (
5862
<Col
59-
className="bg-canvas-100 dark:bg-canvas-0 text-ink-500 relative h-80 w-[250px] flex-none items-center rounded text-6xl ">
63+
className="bg-canvas-100 dark:bg-canvas-0 text-ink-500 relative h-[300px] w-[300px] flex-none items-center rounded text-6xl ">
6064
<Col className=" m-auto items-center gap-1">
6165
<div className="select-none font-semibold">+{photoNums}</div>
6266
<SignUpButton
@@ -149,13 +153,13 @@ export default function ProfileCarousel(props: { profile: Profile }) {
149153
) : (
150154
<Carousel>
151155
{buildArray(profile.pinned_url, profile.photo_urls).map((url, i) => (
152-
<div key={url} className="h-80 w-[250px] flex-none snap-start">
156+
<div key={url} className="h-[300px] w-[300px] flex-none snap-start">
153157
<Image
154158
priority={i < 3}
155159
src={url}
156-
height={360}
157-
width={240}
158-
sizes="(max-width: 640px) 100vw, 240px"
160+
height={300}
161+
width={300}
162+
sizes="(max-width: 640px) 100vw, 300px"
159163
alt=""
160164
className="h-full cursor-pointer rounded object-cover"
161165
onClick={() => {
@@ -167,7 +171,7 @@ export default function ProfileCarousel(props: { profile: Profile }) {
167171
))}
168172
{isCurrentUser && (profile.photo_urls?.length ?? 0) > 1 && (
169173
<button
170-
className="bg-ink-200 text-ink-0 group flex h-80 w-[250px] flex-none cursor-pointer snap-start items-center justify-center rounded ease-in-out"
174+
className="bg-ink-200 text-ink-0 group flex h-[300px] w-[300px] flex-none cursor-pointer snap-start items-center justify-center rounded ease-in-out"
171175
onClick={() => setAddPhotosOpen(true)}
172176
>
173177
<PlusIcon className="w-20 transition-all group-hover:w-24"/>

web/components/profile/profile-info.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function ProfileContent(props: {
176176
fromProfilePage={fromProfilePage}
177177
profile={profile}
178178
/>
179-
{isProfileVisible && profile.photo_urls && <ProfileCarousel profile={profile}/>}
179+
{isProfileVisible && profile.photo_urls && <ProfileCarousel profile={profile} refreshProfile={refreshProfile}/>}
180180
<ProfileCommentSection
181181
onUser={user}
182182
profile={profile}

web/components/widgets/editable-photo-grid.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ const PhotoItem = ({
149149
index === 0 &&
150150
'after:bg-canvas-50/75 after:absolute after:inset-0 after:[mask-image:radial-gradient(transparent_32px,black_32px)]',
151151
]
152-
: ['h-[300px] w-[200px]'],
152+
: ['h-[300px] w-[300px]'],
153153
isDragging && 'opacity-50'
154154
)}
155155
draggable

0 commit comments

Comments
 (0)