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

Merge master #390

Merged
merged 7 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
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
7 changes: 6 additions & 1 deletion src/app/(dashboard)/dashboard/account/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,12 @@ const Account = () => {
<Input label="Email" value={user.email} autocomplete="off" disabled />
<Input label="Prénom" value={firstname} onChange={setFirstname} autocomplete="off" disabled />
<Input label="Nom" value={lastname} onChange={setLastname} autocomplete="off" disabled />
<Input label="Pseudo (Nom d'invocateur pour LoL)" value={username} onChange={setUsername} autocomplete="off" />
<Input
label="Pseudo (Nom d'invocateur pour LoL avec #)"
value={username}
onChange={setUsername}
autocomplete="off"
/>
<Input
label="Nouveau mot de passe"
value={password}
Expand Down
2 changes: 1 addition & 1 deletion src/app/robots.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MetadataRoute } from 'next';

export default function robots(): MetadataRoute.Robots {
if (process.env.NODE_ENV === 'production') {
if (process.env.ENVIRONMENT === 'production') {
return {
rules: {
userAgent: '*',
Expand Down
2 changes: 1 addition & 1 deletion src/components/UI/FileInput.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

>p {
position: absolute;
color: white;
color: black;
font-weight: 600;
top: 50%;
left: 50%;
Expand Down
16 changes: 14 additions & 2 deletions src/components/dashboard/ItemModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const ItemModal = ({
const [infos, setInfos] = useState(item?.infos || null);
const [logo, setLogo] = useState<File | null>(null);
const [display, setDisplay] = useState(item?.display || false);
const [deleteImg, setDeleteImg] = useState(false);

const [attribute, setAttribute] = useState(item?.attribute || null);
const [category, setCategory] = useState(item?.category || null);
Expand All @@ -47,6 +48,10 @@ const ItemModal = ({
return `${year}-${month}-${day}T${hours}:${minutes}`;
};

function deleteLogo(): void {
setDeleteImg(!deleteImg);
}

return (
<Modal
visible={true}
Expand All @@ -58,7 +63,7 @@ const ItemModal = ({
primary
onClick={() => {
let image;
if (item?.image || logo) {
if ((item?.image || logo) && !deleteImg) {
image = true;
}

Expand Down Expand Up @@ -129,7 +134,14 @@ const ItemModal = ({
onChange={(value) => setQuantity(value as unknown as number)}
/>
<Textarea label="Description" value={infos ?? ''} onChange={setInfos} />
<FileInput label="Logo" value={item ? getItemImageLink(item.id) : ''} onChange={setLogo} type={['png']} />
<FileInput
label="Logo"
value={item && item?.image ? getItemImageLink(item.id) : ''}
onChange={setLogo}
type={['png']}
/>
<Checkbox label="Supprimer l'image" value={deleteImg} onChange={deleteLogo} />
<br />
<Checkbox label="Display" value={display} onChange={setDisplay} />
</>
</Modal>
Expand Down
2 changes: 1 addition & 1 deletion src/components/landing/LoginModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function LoginModal({
autocomplete="family-name"
/>
<Input
label="Pseudo (Nom d'invocateur pour LoL)"
label="Pseudo (Nom d'invocateur pour LoL avec #)"
value={signupForm.username}
onChange={(value: string) => updateSignup('username', value)}
autocomplete="nickname"
Expand Down
Loading