Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Binary file added public/darkSettingsArrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/darkSettingsPrivacy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/darkSettingsTerms.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/lightSettingsArrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/lightSettingsPrivacy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/lightSettingsTerms.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions src/app/dashboard/components/SettingsButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import Image from "next/image";

type ButtonType = "button" | "submit" | "reset";

interface IconThemes {
dark: string;
light: string
}

/* Componente criado para abranger botões adicionais */

const SettingsButton = ({

type = "button",
children,
onClick,
srcs,
theme
}: {
type?: ButtonType;
children?: React.ReactElement;
onClick?: React.MouseEventHandler<HTMLButtonElement>;
srcs: IconThemes,
theme: string

}) => {

return (

<button
onClick={onClick}
type={type}
className={`w-full bg-white hover:bg-gradient-to-tr from-white to-neutral-200 p-5 border border-opacity-35 border-black rounded-2xl
dark:bg-gradient-to-t dark:from-neutral-900 dark:to-neutral-700 dark:border-white dark:border-opacity-35`}>

<div className="flex items-start gap-x-5">

<div className="max-h-full py-1">
<Image src={theme == "dark" ? srcs.dark : srcs.light} width={18} height={18} alt=""/>
</div>
{children}
<div className="max-h-full py-2">
<Image src={theme == "dark" ? "/darkSettingsArrow.png" : "/lightSettingsArrow.png"} width={10} height={18} alt=""/>
</div>

</div>
</button>
)
}

export default SettingsButton
47 changes: 46 additions & 1 deletion src/app/dashboard/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,50 @@
"use client"

import { useSelector } from "react-redux";
import SettingsButton from "../components/SettingsButton";
import { Poppins } from "next/font/google";

const poppinsLight = Poppins({ weight: "300", subsets: ["latin"] });
const poppinsNormal = Poppins({ weight: "400", subsets: ["latin"] });

const SettingsPage = () => {
return <div>SettingsPage</div>;

const theme = useSelector(
(state: {
theme: {
value: string;
};
}) => state.theme.value
)

return (
/* Estilização do campo externo em volta dos botões */
<div className="w-full h-full flex flex-col gap-y-10 p-10 text-black dark:text-white bg-white dark:bg-neutral-800">

<SettingsButton srcs={{dark: "/darkSettingsTerms.png", light: "/lightSettingsTerms.png"}} theme={theme}>

<div className="grow max-h-full font-sans text-start">
<div className={`text-xl ${poppinsLight.className}`}>Terms and Conditions</div>
<div className={`text-base text-black text-opacity-50 dark:text-white dark:text-opacity-75 ${poppinsNormal.className}`}>
Rules and guidelines for using a service, detailing user rights and responsibilities in a legally binding agreement.
</div>
</div>

</SettingsButton>

<SettingsButton srcs={{dark: "/darkSettingsPrivacy.png", light: "/lightSettingsPrivacy.png"}} theme={theme}>

<div className="grow max-h-full font-sans text-start">
<div className={`text-xl ${poppinsLight.className}`}>Privacy Policy</div>
<div className={`text-base text-black text-opacity-50 dark:text-white dark:text-opacity-75 ${poppinsNormal.className}`}>
How we collect, use, and protect your personal information.
</div>
</div>

</SettingsButton>

</div>
)
};

export default SettingsPage;