Skip to content

Commit

Permalink
fix: UX
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud AMBROSELLI committed Sep 6, 2023
1 parent 58c2ae2 commit 41e82d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions dashboard/src/components/DocumentsOrganizer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ export default function DocumentsOrganizer({

if (!items.length) return null;

console.log({ documentsTree });

return (
<div id={`${htmlId}-documents`}>
<div className="tw-flex tw-w-full tw-border tw-border-gray-100 tw-py-1 tw-text-xs tw-text-gray-400">
Expand Down Expand Up @@ -346,8 +348,8 @@ function DocumentRow({ document, level, parentIsOpen, position, parentId, color,
}

function Informations({ item }: { item: Item | FolderForTree | RootForTree }) {
if (item.type === 'folder' && ['Dossier Racine', '👪 Documents familiaux'].includes(item.name)) {
return null;
if (item.type === 'folder') {
if (['root', 'treatment', 'consultation'].includes(item._id)) return null;
}
return (
<div style={informationsStyle} className="tw-flex tw-shrink-0 tw-items-center tw-text-xs tw-text-gray-600">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const PersonDocumentsMedical = ({ person }: PersonDocumentsProps) => {
{
_id: 'treatment',
name: 'Traitements',
position: 0,
position: 1,
parentId: 'root',
type: 'folder',
linkedItem: {
Expand Down Expand Up @@ -80,7 +80,7 @@ const PersonDocumentsMedical = ({ person }: PersonDocumentsProps) => {
{
_id: 'consultation',
name: 'Consultations',
position: 1,
position: 0,
parentId: 'root',
type: 'folder',
linkedItem: {
Expand Down Expand Up @@ -316,6 +316,7 @@ const PersonDocumentsMedical = ({ person }: PersonDocumentsProps) => {
}}
onSaveNewOrder={async (nextDocuments) => {
try {
await new Promise((resolve) => setTimeout(resolve, 100)); // if not, the UX is jumpy and shit
const groupedById: any = {
treatment: {},
consultation: {},
Expand Down

0 comments on commit 41e82d9

Please sign in to comment.