Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 8a3fbed

Browse files
authored
refactor(Divider): remove type prop (#558)
* breaking(Divider): remove `type` prop * add entry to changelog * restore styling changes * restore styling changes * update changelog * restore styling changes * omit divider * move to separate variant
1 parent 645cead commit 8a3fbed

File tree

16 files changed

+39
-109
lines changed

16 files changed

+39
-109
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
1717

1818
## [Unreleased]
1919

20+
### BREAKING CHANGES
21+
- `type` prop is replaced with `color` in `Divider` component @layershifter ([#558](https://github.com/stardust-ui/react/pull/558))
22+
2023
### Fixes
2124
- Fix `Provider` is not executing staticStyles with the merged siteVariables @mnajdova ([#559](https://github.com/stardust-ui/react/pull/559))
2225

docs/src/examples/components/Chat/Types/ChatExample.shorthand.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const items = [
4747
key: 'message-id-4',
4848
},
4949
{
50-
content: <Divider content="Today" type="primary" important />,
50+
content: <Divider content="Today" color="primary" important />,
5151
key: 'message-id-5',
5252
},
5353
{

docs/src/examples/components/Chat/Types/ChatExample.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const ChatExample = () => (
3636
/>
3737
</Chat.Item>
3838
<Chat.Item>
39-
<Divider content="Today" type="primary" important />
39+
<Divider content="Today" color="primary" important />
4040
</Chat.Item>
4141
<Chat.Item>
4242
<Chat.Message

docs/src/examples/components/Divider/Types/DividerExamplePrimary.shorthand.tsx

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/src/examples/components/Divider/Types/DividerExamplePrimary.tsx

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/src/examples/components/Divider/Types/DividerExampleSecondary.shorthand.tsx

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/src/examples/components/Divider/Types/DividerExampleSecondary.tsx

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/src/examples/components/Divider/Types/index.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,6 @@ const Types = () => (
1414
description="A Divider can contain text or other content displayed alongside with the line."
1515
examplePath="components/Divider/Types/DividerExampleContent"
1616
/>
17-
<ComponentExample
18-
title="Primary divider"
19-
description="A primary Divider catches the user's attention."
20-
examplePath="components/Divider/Types/DividerExamplePrimary"
21-
/>
22-
<ComponentExample
23-
title="Secondary divider"
24-
description="A secondary Divider is more subtle and less noticeable."
25-
examplePath="components/Divider/Types/DividerExampleSecondary"
26-
/>
2717
</ExampleSection>
2818
)
2919

docs/src/prototypes/chatPane/services/messageFactoryMock.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ function createMessageContentWithAttachments(content: string, messageId: string)
122122
}
123123

124124
function generateDividerProps(props: DividerProps): Divider {
125-
const { content, important, type = 'secondary' } = props
126-
const dividerProps: Divider = { itemType: ChatItemTypes.divider, content, important, type }
125+
const { content, important, color = 'secondary' } = props
126+
const dividerProps: Divider = { itemType: ChatItemTypes.divider, content, important, color }
127127

128128
return dividerProps
129129
}
@@ -158,7 +158,7 @@ export function generateChatProps(chat: ChatData): ChatItemContentProps[] {
158158
chatProps.splice(
159159
myLastMsgIndex + 1,
160160
0,
161-
generateDividerProps({ content: 'Last read', type: 'primary', important: true }),
161+
generateDividerProps({ content: 'Last read', color: 'primary', important: true }),
162162
)
163163
}
164164

docs/src/views/Theming.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@ export default () => (
3939
<ExampleSnippet
4040
render={() => (
4141
<Provider theme={{ siteVariables: { brand: 'hotpink' } }}>
42-
<div>
43-
<Button primary>Branding</Button>
44-
<Divider type="primary">Branding</Divider>
45-
</div>
42+
<Button primary>Branding</Button>
4643
</Provider>
4744
)}
4845
/>

0 commit comments

Comments
 (0)