-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added time synchronization card for Harmony's overview screen
- Loading branch information
1 parent
60b8d20
commit 9b94cb1
Showing
7 changed files
with
382 additions
and
4 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
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
8 changes: 8 additions & 0 deletions
8
libs/core/overview/components/time-synchronization/time-synchronization-ids.enum.ts
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,8 @@ | ||
/** | ||
* Copyright (c) Mudita sp. z o.o. All rights reserved. | ||
* For licensing, see https://github.com/mudita/mudita-center/blob/master/LICENSE.md | ||
*/ | ||
|
||
export enum TimeSynchronizationIds { | ||
SynchronizeButton = "synchronize-button", | ||
} |
84 changes: 84 additions & 0 deletions
84
libs/core/overview/components/time-synchronization/time-synchronization.component.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,84 @@ | ||
/** | ||
* Copyright (c) Mudita sp. z o.o. All rights reserved. | ||
* For licensing, see https://github.com/mudita/mudita-center/blob/master/LICENSE.md | ||
*/ | ||
|
||
import Card, { | ||
CardAction, | ||
CardBody, | ||
CardContent, | ||
CardHeader, | ||
} from "Core/overview/components/card.elements" | ||
import Text, { | ||
TextDisplayStyle, | ||
} from "Core/__deprecated__/renderer/components/core/text/text.component" | ||
import { FunctionComponent } from "Core/core/types/function-component.interface" | ||
import React from "react" | ||
import { defineMessages, FormattedMessage } from "react-intl" | ||
import { DisplayStyle } from "Core/__deprecated__/renderer/components/core/button/button.config" | ||
import ButtonComponent from "Core/__deprecated__/renderer/components/core/button/button.component" | ||
import { TimeSynchronizationIds } from "Core/overview/components/time-synchronization/time-synchronization-ids.enum" | ||
|
||
const messages = defineMessages({ | ||
timeSynchronizationTitle: { | ||
id: "module.overview.timeSynchronizationTitle", | ||
}, | ||
timeSynchronizationDescription: { | ||
id: "module.overview.timeSynchronizationDescription", | ||
}, | ||
timeSynchronizationButton: { | ||
id: "module.overview.timeSynchronizationButton", | ||
}, | ||
}) | ||
|
||
interface Props { | ||
// deviceType: DeviceType | ||
// osVersion?: string | ||
// onUpdateCheck?: () => void | ||
// onUpdate?: () => void | ||
// onDownload?: () => void | ||
} | ||
|
||
const TimeSynchronization: FunctionComponent<Props> = ({ | ||
// deviceType, | ||
// osVersion = "", | ||
// onUpdateCheck = noop, | ||
// onUpdate = noop, | ||
// onDownload = noop, | ||
...props | ||
}) => { | ||
// const { | ||
// checkForUpdateInProgress, | ||
// checkForUpdatePerformed, | ||
// checkForUpdateFailed, | ||
// updateAvailable, | ||
// updateDownloaded, | ||
// } = useUpdateFlowState({ | ||
// deviceType: deviceType, | ||
// }) | ||
return ( | ||
<Card {...props}> | ||
<CardHeader> | ||
<FormattedMessage {...messages.timeSynchronizationTitle} /> | ||
<Text displayStyle={TextDisplayStyle.Label} color="secondary"> | ||
<FormattedMessage {...messages.timeSynchronizationDescription} /> | ||
</Text> | ||
</CardHeader> | ||
<CardBody> | ||
<CardContent> | ||
{/*TODO: Show current Harmony time and date */} | ||
</CardContent> | ||
<CardAction> | ||
<ButtonComponent | ||
displayStyle={DisplayStyle.Secondary} | ||
labelMessage={messages.timeSynchronizationButton} | ||
// onClick={onDownload} | ||
data-testid={TimeSynchronizationIds.SynchronizeButton} | ||
/> | ||
</CardAction> | ||
</CardBody> | ||
</Card> | ||
) | ||
} | ||
|
||
export default TimeSynchronization |
Oops, something went wrong.