-
Notifications
You must be signed in to change notification settings - Fork 536
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds
noTitle
option to RelativeTime component (#4635)
* Adds noTitle option to RelativeTime component * Removes iconbutton story * Reverts package-lock.json changes * Adds changeset * Update packages/react/src/RelativeTime/RelativeTime.tsx Co-authored-by: Clay Miller <clay@smockle.com> * Update clever-pots-leave.md --------- Co-authored-by: Clay Miller <clay@smockle.com> Co-authored-by: Siddharth Kshetrapal <siddharthkp@github.com>
- Loading branch information
1 parent
240fa50
commit bd861cc
Showing
6 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@primer/react': minor | ||
--- | ||
|
||
RelativeTime: Adds `noTitle` prop if you want to not render the `title` attribute with full date time. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/react/src/RelativeTime/RelativeTime.examples.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react' | ||
import RelativeTime from './RelativeTime' | ||
import Link from '../Link' | ||
import {Tooltip} from '../TooltipV2' | ||
|
||
export default { | ||
title: 'Components/RelativeTime/Examples', | ||
component: RelativeTime, | ||
} | ||
|
||
export const NoTitleAttribute = () => <RelativeTime date={new Date('2020-01-01T00:00:00Z')} noTitle={true} /> | ||
|
||
export const LinkWithTooltip = () => ( | ||
<Tooltip text={new Date('2020-01-01T00:00:00Z').toString()}> | ||
<Link href="https://www.github.com"> | ||
<RelativeTime date={new Date('2020-01-01T00:00:00Z')} noTitle={true} /> | ||
</Link> | ||
</Tooltip> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters