change dropdown on link for dashboard user files
This commit is contained in:
@@ -3892,48 +3892,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.section-add-file {
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.section-drop-down-list {
|
|
||||||
position: absolute;
|
|
||||||
left: 80%;
|
|
||||||
top: 50%;
|
|
||||||
max-height: 0;
|
|
||||||
color: v.$text-p;
|
|
||||||
font-size: 16px;
|
|
||||||
border-radius: 20px;
|
|
||||||
padding: 0;
|
|
||||||
border: none;
|
|
||||||
width: fit-content;
|
|
||||||
z-index: 2;
|
|
||||||
font-weight: 500;
|
|
||||||
|
|
||||||
background: #ffffff00;
|
|
||||||
overflow: hidden;
|
|
||||||
transition: all 0.5s ease;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
|
|
||||||
&.opened {
|
|
||||||
max-height: 500px;
|
|
||||||
padding: 15px 10px;
|
|
||||||
box-shadow: 0 4px 20px #00000014;
|
|
||||||
background: v.$white;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
white-space: nowrap;
|
|
||||||
color: v.$p-color;
|
|
||||||
opacity: 0.7;
|
|
||||||
}
|
|
||||||
|
|
||||||
a:hover {
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.violations-table {
|
.violations-table {
|
||||||
background: white;
|
background: white;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
|
|||||||
@@ -2,11 +2,9 @@
|
|||||||
|
|
||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
import { getUserFilesData } from '@/app/actions/fileEntity';
|
import { getUserFilesData } from '@/app/actions/fileEntity';
|
||||||
import { useEffect, useState, useRef } from 'react';
|
|
||||||
import { FileTypeIcon } from '@/app/components/FileTypeIcon';
|
import { FileTypeIcon } from '@/app/components/FileTypeIcon';
|
||||||
import { convertBytes } from '@/app/lib/convertBytes';
|
import { convertBytes } from '@/app/lib/convertBytes';
|
||||||
import { useTranslations } from 'next-intl';
|
import { useTranslations } from 'next-intl';
|
||||||
import { useClickOutside } from '@/app/hooks/useClickOutside';
|
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
|
||||||
type FileItem = {
|
type FileItem = {
|
||||||
@@ -71,15 +69,6 @@ export default function DashboardUserFiles() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const t = useTranslations('Global');
|
const t = useTranslations('Global');
|
||||||
const [openDropDownList, setOpenDropDownList] = useState(false);
|
|
||||||
const dropDownList = useRef(null);
|
|
||||||
useClickOutside(
|
|
||||||
dropDownList,
|
|
||||||
() => {
|
|
||||||
setOpenDropDownList(false)
|
|
||||||
},
|
|
||||||
openDropDownList
|
|
||||||
);
|
|
||||||
|
|
||||||
const formatDate = (timestamp: number) => {
|
const formatDate = (timestamp: number) => {
|
||||||
const date = new Date(timestamp);
|
const date = new Date(timestamp);
|
||||||
@@ -97,30 +86,11 @@ export default function DashboardUserFiles() {
|
|||||||
{t('your-files')}
|
{t('your-files')}
|
||||||
</h3>
|
</h3>
|
||||||
<div
|
<div
|
||||||
className="section-add-file btn view-all-link"
|
className="btn view-all-link"
|
||||||
onClick={() => {
|
|
||||||
setOpenDropDownList(!openDropDownList);
|
|
||||||
}}
|
|
||||||
ref={dropDownList}
|
|
||||||
>
|
>
|
||||||
{t('add')}
|
<Link href='/pages/my-content'>
|
||||||
<div
|
{t('all')}
|
||||||
className={`section-drop-down-list ${openDropDownList ? 'opened' : ''}`}
|
</Link>
|
||||||
>
|
|
||||||
<div
|
|
||||||
className="flex flex-col text-center"
|
|
||||||
>
|
|
||||||
<Link href='/pages/marking-images'>
|
|
||||||
{t('photo-marking')}
|
|
||||||
</Link>
|
|
||||||
<Link href='/pages/marking-video'>
|
|
||||||
{t('video-marking')}
|
|
||||||
</Link>
|
|
||||||
<Link href='/pages/marking-audio'>
|
|
||||||
{t('audio-marking')}
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ export default function DashboardUserViolations() {
|
|||||||
{t('violation')}
|
{t('violation')}
|
||||||
</h3>
|
</h3>
|
||||||
<div
|
<div
|
||||||
className="section-add-file btn view-all-link"
|
className="btn view-all-link"
|
||||||
>
|
>
|
||||||
<Link href='/pages/violations'>
|
<Link href='/pages/violations'>
|
||||||
{t('all')}
|
{t('all')}
|
||||||
|
|||||||
Reference in New Issue
Block a user