Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Staging #892

Merged
merged 38 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
a8b9ca3
feat: new talent page with schema edits, and new region select component
JayeshVP24 Dec 23, 2024
43889b5
ui: minor changes
JayeshVP24 Dec 23, 2024
cc02c51
UX: fixes
JayeshVP24 Dec 24, 2024
1b6b3d5
merge: with staging #1af91bc
JayeshVP24 Dec 24, 2024
befcec8
fix: talent schema enum msgs and remove location enum
JayeshVP24 Dec 24, 2024
7fde149
ui: attempts to make one fold
JayeshVP24 Dec 24, 2024
7492e04
ux: responsovieness, try to fit in mobiles more
JayeshVP24 Jan 3, 2025
c90a0a7
merge: with staging #59849bd
JayeshVP24 Jan 3, 2025
46d290b
fix: region combobox
JayeshVP24 Jan 3, 2025
e7b6a69
ui: regioncombobox lower height for mobile
JayeshVP24 Jan 3, 2025
2a92772
copy: fix copy of public key
JayeshVP24 Jan 3, 2025
5e1e08b
fix: margin top /new/ for mobile only
JayeshVP24 Jan 3, 2025
d81d587
retire countryList.ts
JayeshVP24 Jan 3, 2025
e4f13db
fix: italics
JayeshVP24 Jan 3, 2025
f1a3f3b
chore: add grant title to airtable sync
a20hek Jan 4, 2025
2843588
fix: approve modal input box
a20hek Jan 4, 2025
fe3b060
fix: listing status
a20hek Jan 4, 2025
3743cc3
Merge branch 'main' of github.com:SuperteamDAO/earn into staging
a20hek Jan 4, 2025
6e61832
chore: update community list
JayeshVP24 Jan 6, 2025
574f0ec
merge: with staging #6e61832
JayeshVP24 Jan 6, 2025
45303fb
Merge pull request #874 from SuperteamDAO/feat/new-talent
JayeshVP24 Jan 6, 2025
3616d24
chore: sortings of feed type page
JayeshVP24 Jan 6, 2025
3dbb49e
chore: change copy for invalid link in bounty submission
JayeshVP24 Jan 6, 2025
170cf93
add: superteam poland and korea
JayeshVP24 Jan 6, 2025
fdec4bb
chore: change user banner copy for non talent filled
JayeshVP24 Jan 6, 2025
99bbdd3
chore: add keyboard shortcuts for comment submission
JayeshVP24 Jan 6, 2025
f773b7b
fix: submission export
a20hek Jan 6, 2025
f467225
fix: isFndnPaying draft and default on
JayeshVP24 Jan 6, 2025
11131b6
fix: shortcut comment empty
JayeshVP24 Jan 6, 2025
31f3efa
Merge branch 'staging' of github.com:SuperteamDAO/earn into staging
a20hek Jan 6, 2025
3920e17
fix: korea banner position, footer capitalization
JayeshVP24 Jan 6, 2025
91cd143
chore: add custom positions to region banners
JayeshVP24 Jan 6, 2025
1e67eec
Merge branch 'main' of github.com:SuperteamDAO/earn into staging
a20hek Jan 6, 2025
1733faf
chore: increase opacity of region banners
JayeshVP24 Jan 7, 2025
d4c7d07
chore (dashboard): make public full click to copy, with underline and…
JayeshVP24 Jan 7, 2025
ea5a008
chore: log user out if 401 is triggered
a20hek Jan 7, 2025
da8bc58
chore: log user out if 401 is triggered
a20hek Jan 7, 2025
de9db50
chore (dashboard): make public full click to copy, with underline and…
JayeshVP24 Jan 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,8 @@ enum Regions {
FRANCE
CANADA
SINGAPORE
POLAND
KOREA

UKRAINE
ARGENTINA
Expand Down
4 changes: 2 additions & 2 deletions src/components/modals/EntityNameModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import axios from 'axios';
import Link from 'next/link';
import { useState } from 'react';

Expand All @@ -7,6 +6,7 @@ import { Dialog, DialogContent } from '@/components/ui/dialog';
import { Input } from '@/components/ui/input';
import { PDTG } from '@/constants/Telegram';
import { TERMS_OF_USE } from '@/constants/TERMS_OF_USE';
import { api } from '@/lib/api';
import { useUser } from '@/store/user';

export const EntityNameModal = ({
Expand All @@ -27,7 +27,7 @@ export const EntityNameModal = ({
setLoading(true);
try {
if (user.currentSponsor) {
await axios.post('/api/sponsors/update-entity-name', {
await api.post('/api/sponsors/update-entity-name', {
entityName,
});
await refetchUser();
Expand Down
170 changes: 117 additions & 53 deletions src/components/shared/ImagePicker.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { X } from 'lucide-react';
import { ImagePlus, X } from 'lucide-react';
import React, { useEffect, useRef, useState } from 'react';
import { RxUpload } from 'react-icons/rx';
import { toast } from 'sonner';
Expand All @@ -13,12 +13,16 @@ interface ImagePickerProps {
defaultValue?: {
url: string;
};
variant?: 'default' | 'short';
className?: string;
}

export const ImagePicker = ({
onChange,
onReset,
defaultValue,
variant = 'default',
className,
}: ImagePickerProps) => {
const [preview, setPreview] = useState<string | null>(
defaultValue?.url || null,
Expand Down Expand Up @@ -90,61 +94,121 @@ export const ImagePicker = ({
}
};

return (
<div
className={cn(
'relative mt-2 rounded-md border border-dashed p-4',
isDragging ? 'border-brand-primary' : 'border-slate-300',
)}
onDragEnter={handleDragEnter}
onDragLeave={handleDragLeave}
onDragOver={handleDragOver}
onDrop={handleDrop}
>
<div className="flex">
{preview ? (
<img
className="h-20 w-20 rounded-xl object-cover"
src={preview}
alt="Preview"
/>
) : (
<div className="flex h-20 w-20 items-center justify-center rounded-xl bg-slate-100">
<RxUpload className="size-6 text-slate-500" />
</div>
if (variant === 'short') {
return (
<div
className={cn(
'relative h-14 w-14 rounded-full border bg-slate-100 text-primary',
!preview && 'border-[1.5px] border-dashed border-primary',
isDragging && 'bg-primary-200',
className,
)}
{preview && (
<X
className="absolute right-3 top-3 z-10 h-5 w-5 cursor-pointer bg-transparent text-slate-400"
onClick={handleReset}
/>
onDragEnter={handleDragEnter}
onDragLeave={handleDragLeave}
onDragOver={handleDragOver}
onDrop={handleDrop}
>
<div className="flex h-full w-full overflow-hidden rounded-full">
{preview ? (
<img
className="h-full w-full object-cover"
src={preview}
alt="Preview"
/>
) : (
<div className="flex h-full w-full items-center justify-center">
{isDragging ? (
<ImagePlus className="size-6" />
) : (
<RxUpload className="size-6" />
)}
</div>
)}
{preview && (
<X
className="absolute bottom-0 right-0 z-10 h-5 w-5 cursor-pointer rounded-full border bg-white stroke-[3] p-1 text-slate-400"
onClick={handleReset}
/>
)}
</div>
<Input
ref={fileInputRef}
className="hidden"
accept="image/jpeg, image/png, image/webp"
onChange={(e) => {
const file = e.target.files ? e.target.files[0] : null;
handleFileChange(file);
e.target.value = '';
}}
type="file"
/>
<div
className="absolute bottom-0 left-0 right-0 top-0 cursor-pointer"
onClick={(e) => {
e.stopPropagation();
fileInputRef.current?.click();
}}
/>
</div>
);
} else {
return (
<div
className={cn(
'relative mt-2 rounded-md border border-dashed p-4',
isDragging ? 'border-brand-primary' : 'border-slate-300',
className,
)}
onDragEnter={handleDragEnter}
onDragLeave={handleDragLeave}
onDragOver={handleDragOver}
onDrop={handleDrop}
>
<div className="flex">
{preview ? (
<img
className="h-20 w-20 rounded-xl object-cover"
src={preview}
alt="Preview"
/>
) : (
<div className="flex h-20 w-20 items-center justify-center rounded-xl bg-slate-100">
<RxUpload className="size-6 text-slate-500" />
</div>
)}
{preview && (
<X
className="absolute right-3 top-3 z-10 h-5 w-5 cursor-pointer bg-transparent text-slate-400"
onClick={handleReset}
/>
)}

<div className="flex flex-col justify-center px-5">
<p className="mb-1 font-semibold text-slate-500">
Choose or drag and drop media
</p>
<p className="text-sm text-slate-400">Maximum size 5 MB</p>
<div className="flex flex-col justify-center px-5">
<p className="mb-1 font-semibold text-slate-500">
Choose or drag and drop media
</p>
<p className="text-sm text-slate-400">Maximum size 5 MB</p>
</div>
</div>
<Input
ref={fileInputRef}
className="hidden"
accept="image/jpeg, image/png, image/webp"
onChange={(e) => {
const file = e.target.files ? e.target.files[0] : null;
handleFileChange(file);
e.target.value = '';
}}
type="file"
/>
<div
className="absolute bottom-0 left-0 right-0 top-0 cursor-pointer"
onClick={(e) => {
e.stopPropagation();
fileInputRef.current?.click();
}}
/>
</div>
<Input
ref={fileInputRef}
className="hidden"
accept="image/jpeg, image/png, image/webp"
onChange={(e) => {
const file = e.target.files ? e.target.files[0] : null;
handleFileChange(file);
e.target.value = '';
}}
type="file"
/>
<div
className="absolute bottom-0 left-0 right-0 top-0 cursor-pointer"
onClick={(e) => {
e.stopPropagation();
fileInputRef.current?.click();
}}
/>
</div>
);
);
}
};
Loading