Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Feat: Revamp team settings #232

Merged
merged 71 commits into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
1673573
initial organism
kasperkristensen Dec 28, 2021
1c4f731
added base styles for buttons
kasperkristensen Dec 29, 2021
c829249
added button component and styles from design system
kasperkristensen Dec 29, 2021
e569ace
Merge branch 'feat/revamp-buttons' into feat/revamp-two-split-body
kasperkristensen Dec 29, 2021
8d97833
progress
kasperkristensen Dec 30, 2021
02ed686
Merge branch 'feat/revamp' into feat/revamp-two-split-body
kasperkristensen Dec 30, 2021
3e3e8c4
start work on scrolllistener for body-card
kasperkristensen Jan 3, 2022
d820361
merged revamp branch
kasperkristensen Jan 4, 2022
6e1ca0d
merged revamp
kasperkristensen Jan 5, 2022
2ce4f55
merged feat/revamp
kasperkristensen Jan 5, 2022
eaa6458
finished button component and moved it to fundamentals
kasperkristensen Jan 5, 2022
74eee26
added spinner
kasperkristensen Jan 5, 2022
450380f
Merge branch 'feat/revamp-buttons' into feat/revamp-two-split-body
kasperkristensen Jan 5, 2022
661d0a5
started ts conversion
kasperkristensen Jan 5, 2022
48b9567
made loading optional
kasperkristensen Jan 5, 2022
ae07e25
Merge branch 'feat/revamp-buttons' into feat/revamp-two-split-body
kasperkristensen Jan 5, 2022
c39e5a2
finished layout
kasperkristensen Jan 5, 2022
6b1fb1f
fix attributes on icon type
kasperkristensen Jan 5, 2022
29f5ac3
Merge branch 'fix/icon-type' into feat/revamp-two-split-body
kasperkristensen Jan 5, 2022
53ed170
fix icons to ts
kasperkristensen Jan 5, 2022
51d7a95
finished two split pane
kasperkristensen Jan 5, 2022
be0b192
merged revamp
kasperkristensen Jan 7, 2022
3cf5ad1
fix actionable single button
kasperkristensen Jan 7, 2022
6a854ed
fix use of classNames
kasperkristensen Jan 7, 2022
f37f1ca
fix: Merged in feat/revamp
olivermrbl Jan 9, 2022
64f3c1e
Merge branch 'feat/revamp-two-split-body' into feat/revamp-team-settings
pKorsholm Jan 10, 2022
99a8bb0
delete modal and modal fix
pKorsholm Jan 11, 2022
eed87a9
add btn danger
pKorsholm Jan 11, 2022
a9d3a90
body card for full width
pKorsholm Jan 11, 2022
f0f075a
initial team settings
pKorsholm Jan 11, 2022
49780db
fix button width
pKorsholm Jan 11, 2022
5adabce
initial table
pKorsholm Jan 11, 2022
b04cee5
merge feat/revamp
pKorsholm Jan 11, 2022
8a3f2a7
fix avatar sizing of sidebar
pKorsholm Jan 11, 2022
a3d0c54
add actionables to tablerow
pKorsholm Jan 11, 2022
b06ec07
update table
pKorsholm Jan 11, 2022
6ad4729
update old table
pKorsholm Jan 11, 2022
98f2f8d
adjust default color of team-member
pKorsholm Jan 11, 2022
4ac215a
update tabel in users
pKorsholm Jan 11, 2022
e35794d
create badge component
pKorsholm Jan 11, 2022
a864665
add filtering options to table
pKorsholm Jan 12, 2022
e68939f
chevron down icon
pKorsholm Jan 12, 2022
5ddea30
use filtering options in users view
pKorsholm Jan 12, 2022
8ee8e33
add table search
pKorsholm Jan 12, 2022
fe95a68
add status dot component
pKorsholm Jan 12, 2022
97fd924
make users index typescript
pKorsholm Jan 12, 2022
657f10f
add custom width to tailwind config
pKorsholm Jan 12, 2022
219279c
finalize search
pKorsholm Jan 12, 2022
f347099
merge
pKorsholm Jan 12, 2022
1517cb1
merge feat/revamp
pKorsholm Jan 12, 2022
263239c
enable full card height
pKorsholm Jan 12, 2022
6348022
button width
pKorsholm Jan 12, 2022
dba66c4
classname pruning
pKorsholm Jan 12, 2022
91d4bfc
searchbar toggle
pKorsholm Jan 12, 2022
3ad5633
add margin between actionables
pKorsholm Jan 12, 2022
43d7954
component cleanup
pKorsholm Jan 12, 2022
a943bd4
truncation of wide columns
pKorsholm Jan 12, 2022
5069366
remove unused code from user index domain
pKorsholm Jan 12, 2022
c8549ed
refactoring
pKorsholm Jan 12, 2022
89bb320
delete unused file
pKorsholm Jan 12, 2022
7d96ed2
cleanup
pKorsholm Jan 12, 2022
8845f8f
undo old table tsx
pKorsholm Jan 12, 2022
e616757
styling changes
pKorsholm Jan 12, 2022
a8e8391
better vertical utilization
pKorsholm Jan 13, 2022
63a1604
fix filtering
pKorsholm Jan 17, 2022
92ca72c
Apply suggestions from code review
pKorsholm Jan 17, 2022
30e8a95
guarding against missing options
pKorsholm Jan 17, 2022
6a2472d
pr fix
pKorsholm Jan 17, 2022
2e540b1
Merge branch 'feat/revamp-team-settings' of https://github.com/medusa…
pKorsholm Jan 17, 2022
035b8b6
merge feat/revamp
pKorsholm Jan 17, 2022
e547248
Merge branch 'feat/revamp' into feat/revamp-team-settings
pKorsholm Jan 17, 2022
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
29 changes: 29 additions & 0 deletions src/components/fundamentals/icons/chevron-down.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from "react"
import IconProps from "./types/icon-type"

const ChevronDownIcon: React.FC<IconProps> = ({
size = "24px",
color = "currentColor",
...attributes
}) => {
return (
<svg
width={size}
height={size}
viewBox="0 0 16 16"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...attributes}
>
<path
d="M4 6L8 10L12 6"
stroke={color}
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
)
}

export default ChevronDownIcon
36 changes: 36 additions & 0 deletions src/components/fundamentals/icons/edit-icon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React from "react"
import IconProps from "./icon-type"

const EditIcon: React.FC<IconProps> = ({
size = "24px",
color = "currentColor",
attributes,
}) => {
return (
<svg
width={size}
height={size}
viewBox="0 0 20 20"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...attributes}
>
<path
d="M9 3H4.55556C4.143 3 3.74733 3.16389 3.45561 3.45561C3.16389 3.74733 3 4.143 3 4.55556V15.4444C3 15.857 3.16389 16.2527 3.45561 16.5444C3.74733 16.8361 4.143 17 4.55556 17H15.4444C15.857 17 16.2527 16.8361 16.5444 16.5444C16.8361 16.2527 17 15.857 17 15.4444V11"
stroke={color}
stroke-width="1.4667"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M14.4356 3.43999C14.7173 3.15827 15.0994 3 15.4978 3C15.8962 3 16.2783 3.15827 16.56 3.43999C16.8417 3.72171 17 4.1038 17 4.50221C17 4.90062 16.8417 5.28272 16.56 5.56443L9.8326 12.2919L7 13L7.70815 10.1674L14.4356 3.43999Z"
stroke={color}
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
)
}

export default EditIcon
50 changes: 50 additions & 0 deletions src/components/fundamentals/icons/refresh-icon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import React from "react"
import IconProps from "./icon-type"

const RefreshIcon: React.FC<IconProps> = ({
size = "24px",
color = "currentColor",
attributes,
}) => {
return (
<svg
width={size}
height={size}
viewBox="0 0 20 20"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...attributes}
>
<path
d="M16.5004 2.77765V7.11104H12.167"
stroke={color}
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M3.5 9.99997C3.50114 8.74568 3.86516 7.51851 4.54814 6.46647C5.23113 5.41444 6.2039 4.58248 7.34914 4.07094C8.49438 3.5594 9.76316 3.39013 11.0024 3.58355C12.2417 3.77697 13.3986 4.32482 14.3335 5.16101L16.5002 7.11104"
stroke={color}
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M3.5 17.2223V12.8889H7.83339"
stroke={color}
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M16.5002 10C16.499 11.2543 16.135 12.4815 15.452 13.5335C14.7691 14.5855 13.7963 15.4175 12.651 15.929C11.5058 16.4406 10.237 16.6098 8.99773 16.4164C7.75845 16.223 6.60159 15.6751 5.6667 14.839L3.5 12.8889"
stroke={color}
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
)
}

export default RefreshIcon
31 changes: 31 additions & 0 deletions src/components/fundamentals/status-dot/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from "react"
import clsx from "clsx"

type StatusDotProps = {
title: string
variant: "primary" | "danger" | "warning" | "success"
} & React.HTMLAttributes<HTMLDivElement>

const StatusDot: React.FC<StatusDotProps> = ({
title,
variant = "success",
className,
...props
}) => {
const dotClass = clsx({
"bg-teal-50": variant === "success",
"bg-rose-50": variant === "danger",
"bg-yellow-50": variant === "warning",
"bg-violet-60": variant === "primary",
})
return (
<div className={clsx("flex items-center", className)} {...props}>
<div
className={clsx("w-1.5 h-1.5 mr-2 self-center rounded-full", dotClass)}
></div>
{title}
</div>
)
}

export default StatusDot
12 changes: 8 additions & 4 deletions src/components/molecules/actionables.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,20 @@ type ActionablesProps = {
* If only a single actionable is provided, it will render a button instead.
*/
const Actionables: React.FC<ActionablesProps> = ({ actions }) => {
if (!actions) {
if (!actions?.length) {
return null
}

return actions.length > 1 ? (
<div>
<DropdownMenu.Root>
<DropdownMenu.Trigger asChild>
<Button variant="ghost" size="medium">
<MoreHorizontalIcon />
<Button
className="w-8 h-8 p-1.5 focus:border-none focus:shadow-none"
variant="ghost"
size="small"
>
<MoreHorizontalIcon size={20} />
</Button>
</DropdownMenu.Trigger>

Expand All @@ -39,7 +43,7 @@ const Actionables: React.FC<ActionablesProps> = ({ actions }) => {
>
{actions.map((action, i) => {
return (
<DropdownMenu.Item key={i}>
<DropdownMenu.Item className="mb-1 last:mb-0" key={i}>
{
<Button
variant="ghost"
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/sidebar-team-member/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const getInitial = (
}

const SidebarTeamMember: React.FC<SidebarTeamMemberProps> = ({
color = "bg-violet-40",
color = "bg-violet-60",
user,
}: SidebarTeamMemberProps) => {
const fullName =
Expand Down
92 changes: 92 additions & 0 deletions src/components/molecules/table/filtering-option.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import * as DropdownMenu from "@radix-ui/react-dropdown-menu"
import clsx from "clsx"
import ChevronDownIcon from "../../fundamentals/icons/chevron-down"
import CheckIcon from "../../fundamentals/icons/check-icon"
import React, { useState } from "react"

export type FilteringOptionProps = {
title: string
options: {
title: string
count?: number
onClick: () => void
}[]
} & React.HTMLAttributes<HTMLDivElement>

const FilteringOptions: React.FC<FilteringOptionProps> = ({
title,
options,
className,
...props
}) => {
const [selected, setSelected] = useState(options?.[0]?.title || "All")
const [open, setOpen] = useState(false)
return (
<div
className={clsx(
"inter-small-regular flex text-grey-50 mr-6 last:mr-0",
className
)}
{...props}
>
<span className="">{title}:</span>
<DropdownMenu.Root onOpenChange={setOpen}>
<DropdownMenu.Trigger
asChild
className={clsx(
"inter-small-regular text-grey-50 flex items-center pl-1.5 pr-0.5 rounded active:bg-grey-5 hover:bg-grey-5",
{ "bg-grey-5": open }
)}
>
<div className="flex align-center">
{selected}
<div className="text-grey-40 h-min">
<ChevronDownIcon size={16} />
</div>
</div>
</DropdownMenu.Trigger>
<DropdownMenu.Content
sideOffset={8}
className="bg-grey-0 p-2 border border-grey-20 rounded-rounded shadow-dropdown"
>
{options.map((opt, idx) => (
<DropdownMenu.DropdownMenuItem
onSelect={() => {
opt.onClick()
setSelected(opt.title)
}}
disabled={opt.count < 1}
className={clsx(
"py-1.5 my-1 w-48 px-3 flex items-center rounded text-grey-90 hover:border-0 hover:outline-none inter-small-semibold",
{ "cursor-pointer hover:bg-grey-10": opt.count > 0 }
)}
>
{selected === opt.title && (
<span className="w-4">
<CheckIcon size={16} />
</span>
)}
<div
className={clsx("ml-3 w-full flex justify-between", {
"ml-7": selected !== opt.title,
"text-grey-30": opt.count < 1,
})}
>
{opt.title}
<span
className={clsx("inter-small-regular text-grey-40 ml-3", {
"text-grey-30": opt.count < 1,
})}
>
{opt.count}
</span>
</div>
</DropdownMenu.DropdownMenuItem>
))}
</DropdownMenu.Content>
</DropdownMenu.Root>
</div>
)
}

export default FilteringOptions
Loading