Skip to content

Commit

Permalink
refactor(list): remove horizontal control
Browse files Browse the repository at this point in the history
  • Loading branch information
tarantilis committed Apr 11, 2022
1 parent ebf11bd commit 1f5e576
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 56 deletions.
1 change: 0 additions & 1 deletion src/ui/List/DefaultList.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ Default.args = {
floated: 'left',
animated: false,
divided: false,
horizontal: false,
items: ['List Item 1', 'List Item 2', 'List Item 3', 'List Item 4'],
};
20 changes: 3 additions & 17 deletions src/ui/List/DescriptionList.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ export default {
defaultValue: { summary: false },
},
},
horizontal: {
description: 'a list can be formatted to have items appear horizontally',
table: {
type: { summary: 'boolean' },
defaultValue: { summary: false },
},
},
items: {
description: 'array of list content',
table: {
Expand All @@ -48,10 +41,10 @@ export default {
},
};

function DescriptionList(items, floated, animated, divided, horizontal) {
function DescriptionList(items, floated, animated, divided) {
return (
<Container>
<List animated={animated} divided={divided} horizontal={horizontal}>
<List animated={animated} divided={divided}>
{items.map((item, index) => (
<List.Item key={index}>
<List.Content>
Expand All @@ -68,20 +61,13 @@ function DescriptionList(items, floated, animated, divided, horizontal) {
}

export const Default = (args) => {
return DescriptionList(
args.items,
args.floated,
args.animated,
args.divided,
args.horizontal,
);
return DescriptionList(args.items, args.floated, args.animated, args.divided);
};

Default.args = {
floated: 'right',
animated: false,
divided: false,
horizontal: false,
items: [
{ header: 'Header 1', content: 'Description content 1' },
{ header: 'Header 2', content: 'Description content 2' },
Expand Down
18 changes: 2 additions & 16 deletions src/ui/List/OrderedList.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ export default {
defaultValue: { summary: false },
},
},
horizontal: {
description: 'a list can be formatted to have items appear horizontally',
table: {
type: { summary: 'boolean' },
defaultValue: { summary: false },
},
},
items: {
description: 'array of list content',
table: {
Expand All @@ -40,13 +33,7 @@ export default {
function OrderedList(items, animated, divided, horizontal) {
return (
<Container>
<List
as="ul"
ordered
animated={animated}
divided={divided}
horizontal={horizontal}
>
<List as="ul" ordered animated={animated} divided={divided}>
{items.map((item, index) => (
<List.Item as="a" key={index}>
{item.content}
Expand Down Expand Up @@ -89,7 +76,7 @@ function OrderedList(items, animated, divided, horizontal) {
}

export const Default = (args) => {
return OrderedList(args.items, args.animated, args.divided, args.horizontal);
return OrderedList(args.items, args.animated, args.divided);
};

Default.args = {
Expand Down Expand Up @@ -150,5 +137,4 @@ Default.args = {
],
animated: false,
divided: false,
horizontal: false,
};
25 changes: 3 additions & 22 deletions src/ui/List/UnorderedList.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ export default {
defaultValue: { summary: false },
},
},
horizontal: {
description: 'a list can be formatted to have items appear horizontally',
table: {
type: { summary: 'boolean' },
defaultValue: { summary: false },
},
},
items: {
description: 'array of list content',
table: {
Expand All @@ -37,16 +30,10 @@ export default {
},
};

function UnorderedList(animated, divided, horizontal, items) {
function UnorderedList(animated, divided, items) {
return (
<Container>
<List
bulleted
animated={animated}
divided={divided}
horizontal={horizontal}
as="ul"
>
<List bulleted animated={animated} divided={divided} as="ul">
{items &&
items.map((item, index) => (
<List.Item as="li" key={index}>
Expand All @@ -59,18 +46,12 @@ function UnorderedList(animated, divided, horizontal, items) {
}

export const Default = (args) => {
return UnorderedList(
args.animated,
args.divided,
args.horizontal,
args.items,
);
return UnorderedList(args.animated, args.divided, args.items);
};

Default.args = {
animated: false,
divided: false,
horizontal: false,
items: [
{
header: 'header 1',
Expand Down

0 comments on commit 1f5e576

Please sign in to comment.