Skip to content

Commit

Permalink
Merge pull request #99 from cabcookie/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
cabcookie authored Jun 3, 2024
2 parents 5485d28 + b0ad595 commit 8cdf417
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 40 deletions.
13 changes: 8 additions & 5 deletions components/ui-elements/accordion/DefaultAccordionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
AccordionItem,
AccordionTrigger,
} from "@/components/ui/accordion";
import { cn } from "@/lib/utils";
import Link from "next/link";
import { FC, ReactNode } from "react";
import { BiLinkExternal } from "react-icons/bi";
Expand Down Expand Up @@ -30,19 +31,21 @@ const DefaultAccordionItem: FC<DefaultAccordionItemProps> = ({
}) =>
isVisible && (
<AccordionItem value={value}>
<AccordionTrigger className={className}>
<div className="flex flex-row gap-2 start-0 align-middle">
<div>{title}</div>
<AccordionTrigger className={cn("w-full", className)}>
<div className="flex flex-row gap-2 items-center w-full">
<div className="flex-shrink-0">{title}</div>
{link && (
<Link
href={link}
className="mt-1 text-muted-foreground hover:text-primary"
className="mt-1 text-muted-foreground hover:text-primary flex-shrink-0"
>
<BiLinkExternal />
</Link>
)}
{subTitle && accordionSelectedValue !== value && (
<div className="font-normal space-x-2 truncate">{subTitle}</div>
<div className="flex-1 min-w-0 font-normal space-x-2 truncate">
{subTitle}
</div>
)}
</div>
</AccordionTrigger>
Expand Down
56 changes: 27 additions & 29 deletions components/ui-elements/project-details/next-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,34 +52,32 @@ const NextActions: FC<NextActionsProps> = ({
others,
saveFn,
accordionSelectedValue,
}) => {
return (
<DefaultAccordionItem
value="next-actions"
title="Next Actions"
accordionSelectedValue={accordionSelectedValue}
subTitle={
<small>
{own &&
(typeof own === "string" ? own : getTextFromEditorJsonContent(own))}
</small>
}
isVisible
>
<div className="flex flex-col md:flex-row gap-4 w-full p-0 m-0">
<NextActionHelper
title="My next actions"
actions={own}
saveFn={(actions) => saveFn(actions, others || "")}
/>
<NextActionHelper
title="Other's next actions"
actions={others}
saveFn={(actions) => saveFn(own || "", actions)}
/>
</div>
</DefaultAccordionItem>
);
};
}) => (
<DefaultAccordionItem
value="next-actions"
title="Next Actions"
accordionSelectedValue={accordionSelectedValue}
subTitle={
<small>
{own &&
(typeof own === "string" ? own : getTextFromEditorJsonContent(own))}
</small>
}
isVisible
>
<div className="flex flex-col md:flex-row gap-4 w-full p-0 m-0">
<NextActionHelper
title="My next actions"
actions={own}
saveFn={(actions) => saveFn(actions, others || "")}
/>
<NextActionHelper
title="Other's next actions"
actions={others}
saveFn={(actions) => saveFn(own || "", actions)}
/>
</div>
</DefaultAccordionItem>
);

export default NextActions;
8 changes: 2 additions & 6 deletions docs/releases/next.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Prioritäten für Accounts und Projekte (Version :VERSION)
# Accordion-Breite optimiert (Version :VERSION)

Die Priorität eines Accounts und von Projekten wird nun anhand der Order Number und dem erwarteten Umsatz beim Laden der Daten berechnet.

## UI vereinfacht

Mit Hilfe von Accordions können wir nun viele Informationen anzeigen, ohne dass sie viel Raum auf der Seite einnehmen. Die Listen lassen sich auf- und zuklappen und somit alle relevanten Informationen anzeigen, wenn notwendig.
Wenn ein Accordion zu viel Text im Untertitel hatte, wurde es breiter, als der Screen. Das ist jetzt behoben.

0 comments on commit 8cdf417

Please sign in to comment.