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

enable style overrides in timestamp #4109

Merged
merged 4 commits into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
1 change: 1 addition & 0 deletions packages/components/psammead-timestamp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
|---------|-------------|
| 4.0.6 | [PR#4109](https://github.com/bbc/psammead/pull/4109) enable time element style overrides |
| 4.0.5 | [PR#4072](https://github.com/bbc/psammead/pull/4072) Talos - Bump Dependencies - @bbc/psammead-styles |
| 4.0.4 | [PR#4052](https://github.com/bbc/psammead/pull/4052) Talos - Bump Dependencies - @bbc/gel-foundations |
| 4.0.3 | [PR#4029](https://github.com/bbc/psammead/pull/4029) Talos - Bump Dependencies - @bbc/psammead-styles |
Expand Down
2 changes: 1 addition & 1 deletion packages/components/psammead-timestamp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/components/psammead-timestamp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-timestamp",
"version": "4.0.5",
"version": "4.0.6",
"main": "dist/index.js",
"module": "esm/index.js",
"sideEffects": false,
Expand Down
4 changes: 4 additions & 0 deletions packages/components/psammead-timestamp/src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const Timestamp = ({
padding,
service,
darkMode,
className,
}) => (
<StyledTimestamp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component seems to be unnecessary - it's just drilling props untouched

I think deleting line 29-49 and just exporting the StyledTimestamp directly might be better

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

untouched

Not entirely - it's renaming datetime to dateTime

dateTime={datetime}
Expand All @@ -42,6 +43,7 @@ const Timestamp = ({
padding={padding}
service={service}
darkMode={darkMode}
className={className}
>
{children}
</StyledTimestamp>
Expand All @@ -51,6 +53,7 @@ Timestamp.defaultProps = {
typographyFunc: getBrevier,
padding: true,
darkMode: false,
className: '',
};

Timestamp.propTypes = {
Expand All @@ -61,6 +64,7 @@ Timestamp.propTypes = {
script: shape(scriptPropType).isRequired,
service: string.isRequired,
darkMode: bool,
className: string,
};

export default Timestamp;
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
|---------|-------------|
| 5.0.14 | [PR#4109](https://github.com/bbc/psammead/pull/4109) enable time element style overrides |
| 5.0.13 | [PR#4073](https://github.com/bbc/psammead/pull/4073) Talos - Bump Dependencies - @bbc/psammead-timestamp |
| 5.0.12 | [PR#4053](https://github.com/bbc/psammead/pull/4053) Talos - Bump Dependencies - @bbc/psammead-timestamp |
| 5.0.11 | [PR#4052](https://github.com/bbc/psammead/pull/4052) Talos - Bump Dependencies - @bbc/gel-foundations |
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-timestamp-container",
"version": "5.0.13",
"version": "5.0.14",
"main": "dist/index.js",
"module": "esm/index.js",
"sideEffects": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const TimestampContainer = ({
locale,
service,
altCalendar,
className,
}) => {
let altDateTime;
if (!isValidDateTime(new Date(timestamp))) {
Expand Down Expand Up @@ -56,6 +57,7 @@ const TimestampContainer = ({
padding={padding}
script={script}
service={service}
className={className}
>
{timestampText}
</Timestamp>
Expand All @@ -74,6 +76,7 @@ TimestampContainer.propTypes = {
script: shape(scriptPropType).isRequired,
locale: string,
service: string.isRequired,
className: string,
altCalendar: shape({
formatDate: func.isRequired,
}),
Expand All @@ -88,6 +91,7 @@ TimestampContainer.defaultProps = {
suffix: null,
locale: 'en-gb',
altCalendar: null,
className: '',
};

export default TimestampContainer;