Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c396adc
Update overflow behavior in ContactList and ProtectedData components
ErwanDecoster Apr 2, 2025
32a4e71
Update discreet_outline variant in Button component for improved styling
ErwanDecoster Apr 2, 2025
525afc9
Update NavBar component styles for improved visibility
ErwanDecoster Apr 2, 2025
9f3283a
Update layout and styling in ProtectedData component for better respo…
ErwanDecoster Apr 2, 2025
601fe1f
Update margin in ProtectedData component for improved layout
ErwanDecoster Apr 2, 2025
3dfd58a
Move GrantAccessModal DocLink after buttons
ErwanDecoster Apr 2, 2025
c0d6172
Update layout in ProtectedData component for improved responsiveness
ErwanDecoster Apr 2, 2025
bb2fc31
fix: use scrool instead of wrap for tag item
ErwanDecoster Apr 2, 2025
4f95a22
feat: update contact owner display to indicate ownership
ErwanDecoster Apr 2, 2025
746daa1
fix: center MainLayout content
ErwanDecoster Apr 3, 2025
545a09a
feat: add logo link to My Data in TopNavBar for improved navigation
ErwanDecoster Apr 3, 2025
ed53841
fix: many pages overflow
ErwanDecoster Apr 3, 2025
30a5c08
style: update table headers to use uppercase and prevent text wrapping
ErwanDecoster Apr 3, 2025
50ca012
fix: adjust layout width for MainLayout component
ErwanDecoster Apr 3, 2025
e18eadf
fix: wrap text in paragraphs for better readability in steps component
ErwanDecoster Apr 3, 2025
35519ba
fix: restrict layout width in MainLayout component for better respons…
ErwanDecoster Apr 3, 2025
0587f8e
fix: remove previous and next button use step number instead, fix som…
ErwanDecoster Apr 3, 2025
83a0be1
style: update select font weight to extrabold
ErwanDecoster Apr 3, 2025
eb9255e
feat: add new visual assets for steps and update Resources component …
ErwanDecoster Apr 3, 2025
0c05c74
style: update font weight to extrabold in ProtectedDataDetails component
ErwanDecoster Apr 3, 2025
1b365fe
fix: add minimum width to Resources component for improved layout
ErwanDecoster Apr 3, 2025
72bd03d
fix: remove unnecessary comment in router configuration
ErwanDecoster Apr 3, 2025
a470213
fix: update navigation paths in AddProtectedData component
ErwanDecoster Apr 3, 2025
b66ca08
fix: set base path for production and development in Vite configuration
ErwanDecoster Apr 3, 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
Binary file added src/assets/steps/lock_file_visual.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 src/assets/steps/lock_visual.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
4 changes: 2 additions & 2 deletions src/components/navBar/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function NavBar() {

<Label
htmlFor="dev-mode"
className="flex items-center space-x-2 py-1"
className="flex items-center space-x-2 py-1 text-white"
>
<Switch
id="dev-mode"
Expand All @@ -72,7 +72,7 @@ export function NavBar() {
<span>Dev Mode</span>
</Label>

<hr className="border-grey-700 border-t" />
<hr className="border-grey-600 border-t" />

<div className="mb-16">
<Button
Expand Down
11 changes: 8 additions & 3 deletions src/components/navBar/TopNavBar.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
import { LogOut } from 'react-feather';
import { Link } from 'react-router-dom';
import { useLoginLogout } from '@/hooks/useLoginLogout';
import useUserStore from '@/stores/useUser.store';
import iExecLogo from '../../assets/iexec-logo.svg';
import { AddressChip } from './AddressChip';

export function TopNavBar() {
const { isConnected, address } = useUserStore();
const { logout } = useLoginLogout();

return (
<>
<div className="flex items-center justify-between pt-5 lg:pt-10">
<Link to="/my-data" className="-m-2 flex items-center p-2 lg:invisible">
<img src={iExecLogo} width="25" height="25" alt="iExec logo" />
</Link>
{isConnected && (
<div className="flex w-full max-w-[1260px] items-center justify-end pt-5 pr-9 lg:pt-10 lg:pr-0">
<div className="flex max-w-[1260px] items-center pr-10 lg:pr-0">
<AddressChip address={address!} className="ml-6" />
<button
type="button"
Expand All @@ -21,6 +26,6 @@ export function TopNavBar() {
</button>
</div>
)}
</>
</div>
);
}
3 changes: 1 addition & 2 deletions src/components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ const buttonVariants = cva(
white: 'hover:bg-grey-400 bg-white text-black',
danger: 'bg-[#BF3131] text-white hover:bg-[#BF3131]/40',
outline: 'border-grey-50 border hover:bg-white/10 hover:text-white',
discreet_outline:
'border-grey-600 hover:bg-grey-800 border hover:text-white',
discreet_outline: 'border-grey-600 hover:bg-grey-800 border text-white',
chip: 'from-grey-500 hover:before:bg-background relative z-0 overflow-hidden bg-gradient-to-b to-transparent before:absolute before:inset-px before:-z-10 before:rounded-[29px] before:bg-[#14141a] before:duration-300',
text: '',
},
Expand Down
4 changes: 2 additions & 2 deletions src/layouts/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export default function MainLayout() {
return (
<div className="flex">
<NavBar />
<div className="m:px-10 w-full px-6">
<div className="m:px-10 mx-auto w-full max-w-[1260px] px-6">
<TopNavBar />
<div className="mt-10 mb-24 max-w-[1260px] flex-1">
<div className="mt-10 mb-24 max-w-[1260px]">
{!isConnected ? <ConnectWallet /> : <Outlet />}
</div>
</div>
Expand Down
22 changes: 11 additions & 11 deletions src/modules/myData/protectedData/GrantAccessModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,17 @@ export default function GrantAccessModal({
)}
</Alert>
)}
<div className="mt-2 flex justify-center gap-5">
<Button
variant="outline"
onClick={() => setSwitchingModalOpen(false)}
>
Cancel
</Button>
<Button type="submit" isLoading={grantAccessMutation.isPending}>
Add User
</Button>
</div>
<DocLink className="bg-grey-600 border-grey-500">
dataprotector-sdk / Method called:{' '}
<a
Expand Down Expand Up @@ -232,17 +243,6 @@ export default function GrantAccessModal({
{'}'});
</a>
</DocLink>
<div className="mt-2 flex justify-center gap-5">
<Button
variant="outline"
onClick={() => setSwitchingModalOpen(false)}
>
Cancel
</Button>
<Button type="submit" isLoading={grantAccessMutation.isPending}>
Add User
</Button>
</div>
</form>
</DialogContent>
</Dialog>
Expand Down
6 changes: 3 additions & 3 deletions src/modules/myData/protectedData/ProtectedDataDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function ProtectedDataDetails({
<div className="grid gap-6 md:grid-cols-3">
<div className="radial-bg before:bg-grey-800 md:before:bg-grey-900 rounded-20 relative z-0 flex flex-col gap-6 overflow-hidden p-8 before:absolute before:inset-px before:-z-10 before:rounded-[calc(20px-1px)]">
<div className="z-30 grid gap-6">
<div className="flex items-center gap-4">
<div className="font-anybody flex items-center gap-4 font-extrabold">
<div className="rounded-lg bg-yellow-300/10 p-2.5 text-yellow-300">
<ProtectedDataIcon size={20} />
</div>
Expand All @@ -39,7 +39,7 @@ export function ProtectedDataDetails({
</div>
<div className="radial-bg before:bg-grey-800 md:before:bg-grey-900 rounded-20 relative z-0 flex flex-col gap-6 overflow-hidden p-8 before:absolute before:inset-px before:-z-10 before:rounded-[calc(20px-1px)]">
<div className="z-30 grid gap-6">
<div className="flex items-center gap-4">
<div className="font-anybody flex items-center gap-4 font-extrabold">
<div className="rounded-lg bg-yellow-300/10 p-2.5 text-yellow-300">
<User size={20} />
</div>
Expand All @@ -63,7 +63,7 @@ export function ProtectedDataDetails({
</div>
<div className="radial-bg before:bg-grey-800 md:before:bg-grey-900 rounded-20 relative z-0 flex flex-col gap-6 overflow-hidden p-8 before:absolute before:inset-px before:-z-10 before:rounded-[calc(20px-1px)]">
<div className="z-30 grid gap-6">
<div className="flex items-center gap-4">
<div className="font-anybody flex items-center gap-4 font-extrabold">
<div className="rounded-lg bg-yellow-300/10 p-2.5 text-yellow-300">
<Link size={20} />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ export const router = createBrowserRouter(
},
],
{
basename: '/web3messaging', // Remplacez '/votre-basepath' par le chemin de base souhaité
basename: '/web3messaging',
}
);
22 changes: 14 additions & 8 deletions src/views/contact/contactList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export default function ContactList() {
<h1 className="text-xl font-bold">Send Message to contact</h1>
<p>Email or telegram contact info</p>
</div>
<div className="flex flex-wrap gap-x-6 gap-y-3">
<div className="-mb-2 flex gap-x-6 gap-y-3 overflow-auto pb-2">
{Object.keys(COLOR_CLASSES).map((key) => {
return (
<Button
Expand All @@ -176,16 +176,20 @@ export default function ContactList() {
);
})}
</div>
<div className="border-grey-600 my-5 grid w-full grid-cols-[2fr_2fr_2fr_2fr_2fr_1fr] items-center overflow-hidden rounded-3xl border [&>div]:px-5 [&>div]:py-5">
<div className="text-grey-300 text-xs font-semibold">Name</div>
<div className="text-grey-300 text-xs font-semibold">
<div className="border-grey-600 my-5 grid grid-cols-[2fr_2fr_2fr_2fr_2fr_1fr] items-center overflow-auto rounded-3xl border [&>div]:px-5 [&>div]:py-5">
<div className="text-grey-300 min-w-32 text-xs font-semibold text-nowrap uppercase">
Name
</div>
<div className="text-grey-300 text-xs font-semibold text-nowrap uppercase">
Protected data address
</div>
<div className="text-grey-300 text-xs font-semibold">Owner address</div>
<div className="text-grey-300 text-xs font-semibold">
<div className="text-grey-300 text-xs font-semibold text-nowrap uppercase">
Owner address
</div>
<div className="text-grey-300 text-xs font-semibold text-nowrap uppercase">
Remaining access
</div>
<div className="text-grey-300 col-span-2 text-xs font-semibold">
<div className="text-grey-300 col-span-2 min-w-52 text-xs font-semibold text-nowrap uppercase">
TYPE (Telegram/Mail)
</div>
{!pagesOfContacts || pagesOfContacts?.length === 0 ? (
Expand Down Expand Up @@ -218,7 +222,9 @@ export default function ContactList() {
</div>
<div className="truncate">
<span className="truncate whitespace-nowrap">
{contact.owner === userAddress ? 'Me' : contact.owner}
{contact.owner === userAddress
? `(Mine) ${contact.owner}`
: contact.owner}
</span>
</div>
<div className="truncate">{contact.volume}</div>
Expand Down
10 changes: 6 additions & 4 deletions src/views/myData/addProtectedData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default function AddProtectedData() {
});

const updateStep = (step: number) => {
navigate(`${location.pathname}?step=${step}`);
navigate(`/my-data/add-protected-data?step=${step}`);
setCurrentStep(step);
};

Expand Down Expand Up @@ -85,7 +85,7 @@ export default function AddProtectedData() {

const handleBackClick = () => {
if (currentStep === 0) {
navigate('/my-data');
// navigate('/my-data');
} else {
updateStep(currentStep - 1);
}
Expand Down Expand Up @@ -130,7 +130,7 @@ export default function AddProtectedData() {
queryClient.invalidateQueries({
queryKey: ['apps', userAddress],
});
navigate('/my-data');
// navigate('/my-data');
toast({
title: 'You have successfully add a new protected data.',
variant: 'success',
Expand Down Expand Up @@ -210,7 +210,9 @@ export default function AddProtectedData() {
<div className="rounded-lg bg-yellow-300/10 p-2.5 text-yellow-300">
{COLOR_CLASSES[key].icon}
</div>
<p className="font-anybody capitalize">{key}</p>
<p className="font-anybody font-extrabold capitalize">
{key}
</p>
</div>
<p>{COLOR_CLASSES[key].dataReadableType}</p>
</div>
Expand Down
12 changes: 6 additions & 6 deletions src/views/myData/protectedData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default function ProtectedData() {
protectedData={protectedData.data}
/>
)}
<h1 className="relative w-fit text-4xl sm:text-left md:max-w-3/4 md:text-center">
<h1 className="relative mt-9 w-fit text-4xl sm:text-left md:mt-0 md:max-w-3/4 md:text-center">
{protectedData.data && (
<span
className={cn(
Expand All @@ -124,7 +124,7 @@ export default function ProtectedData() {
userAddress={userAddress}
/>
<div className="space-x-2">
<div className="flex items-center justify-between gap-2">
<div className="flex flex-col items-center justify-between gap-2 text-center text-pretty sm:flex-row sm:text-left">
<div>
<h2 className="text-xl font-bold">Authorized users</h2>
<p>
Expand All @@ -139,11 +139,11 @@ export default function ProtectedData() {
Authorize new user
</Button>
</div>
<div className="border-grey-600 my-5 grid w-full grid-cols-[2fr_2fr_1fr] items-center overflow-hidden rounded-3xl border [&>div]:px-5 [&>div]:py-5">
<div className="text-grey-300 text-xs font-semibold">
<div className="border-grey-600 my-5 grid w-full grid-cols-[2fr_2fr_1fr] items-center overflow-auto rounded-3xl border [&>div]:px-5 [&>div]:py-5">
<div className="text-grey-300 text-xs font-semibold text-nowrap uppercase">
User address
</div>
<div className="text-grey-300 col-span-2 text-xs font-semibold">
<div className="text-grey-300 col-span-2 text-xs font-semibold text-nowrap uppercase">
Number of Access
</div>
{!grantedAccess.data || grantedAccess.data?.length === 0 ? (
Expand Down Expand Up @@ -194,7 +194,7 @@ export default function ProtectedData() {
)}
</div>
</div>
<Button asChild variant="outline" className="ml-auto w-fit">
<Button asChild variant="outline" className="mx-auto w-fit sm:mr-0">
<Link to="/my-data">Back to my data</Link>
</Button>
<DocLink>
Expand Down
4 changes: 2 additions & 2 deletions src/views/myData/protectedDataList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export default function ProtectedDataList() {
chunkArray(getProtectedDataByType(selectedTab) || [], itemsPerPage);

return (
<div className="grid gap-10">
<div className="flex flex-col gap-10">
<div className="radial-bg before:bg-grey-800 relative z-0 grid gap-6 overflow-hidden rounded-2xl p-8 before:absolute before:inset-px before:-z-10 before:rounded-[15px] md:pr-56">
<div>
<h1 className="text-center sm:text-left">Protect a new data</h1>
Expand Down Expand Up @@ -162,7 +162,7 @@ export default function ProtectedDataList() {
authorize, and revoke access.
</p>
</div>
<div className="flex flex-wrap gap-x-6 gap-y-3">
<div className="-mb-2 flex gap-x-6 gap-y-3 overflow-auto pb-2">
{Object.keys(COLOR_CLASSES).map((key) => {
return (
<Button
Expand Down
49 changes: 25 additions & 24 deletions src/views/resources/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import { useState } from 'react';
import telegram_visual from '@/assets/telegram_visual.png';
import lock_file_visual from '@/assets/steps/lock_file_visual.png';
import lock_visual from '@/assets/steps/lock_visual.png';
import send_visual from '@/assets/steps/send_visual.png';
import { Button } from '@/components/ui/button';
import { cn } from '@/utils/style.utils';
import { steps } from './steps';

export default function Resources() {
const [currentStep, setCurrentStep] = useState(0);

const stepsVisual = [send_visual, lock_visual, lock_file_visual];

return (
<div className="flex flex-col gap-16 md:flex-row">
<div className="radial-bg relative max-h-52 min-h-52 overflow-hidden rounded-2xl p-px md:max-h-136 md:w-2/5">
<div className="radial-bg relative max-h-52 min-h-52 min-w-72 overflow-hidden rounded-2xl p-px md:max-h-136 md:w-2/5">
<div className="bg-background absolute inset-px z-0 overflow-hidden rounded-[calc(16px-1px)] before:absolute before:right-0 before:z-0 before:aspect-square before:h-1/3 before:scale-110 before:rounded-full before:bg-[#BC70FD] before:blur-[100px] after:absolute after:top-0 after:right-0 after:-z-10 after:aspect-[1/2] after:h-full after:scale-125 after:rounded-full after:bg-[#00115C]/70 after:blur-3xl md:before:translate-x-1/2 md:after:translate-x-1/3 md:after:-translate-y-1/3">
<img
src={telegram_visual}
src={stepsVisual[currentStep]}
className="z-30 mx-auto mt-8 w-4/5 max-w-64 md:mt-20"
alt=""
/>
Expand All @@ -26,8 +30,13 @@ export default function Resources() {
{steps.length} steps
</p>
{steps.map((step, index) => (
<div key={index} className="flex gap-4">
<div className="flex flex-col items-center">
<div key={index} className="flex min-h-16 gap-4">
<Button
onClick={() => setCurrentStep(index)}
className="flex flex-col items-center justify-normal gap-0"
variant="text"
size="none"
>
<span
className={cn(
'flex size-10 items-center justify-center rounded-full border',
Expand All @@ -46,25 +55,17 @@ export default function Resources() {
)}
/>
)}
</div>
<div className="flex flex-col justify-end space-y-4 py-2">
<h2 className="text-base!">{step.title}</h2>
{currentStep === index && <div>{step.content}</div>}
<div className="mt-2 flex justify-end gap-5">
{currentStep === index && currentStep > 0 && (
<Button
variant="outline"
onClick={() => setCurrentStep((prev) => prev - 1)}
>
Previous step
</Button>
)}
{currentStep === index && currentStep !== steps.length - 1 && (
<Button onClick={() => setCurrentStep((prev) => prev + 1)}>
Next step
</Button>
)}
</div>
</Button>
<div className="flex max-w-full grow flex-col space-y-4.5 py-2">
<Button
variant="text"
size="none"
className="justify-normal text-left"
onClick={() => setCurrentStep(index)}
>
<h2 className="text-base! text-wrap!">{step.title}</h2>
</Button>
{currentStep === index && <>{step.content}</>}
</div>
</div>
))}
Expand Down
Loading