forked from umami-software/umami
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'mikecao/master'
- Loading branch information
Showing
84 changed files
with
783 additions
and
434 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,10 @@ | |
min-width: 160px; | ||
} | ||
|
||
.text { | ||
flex: 1; | ||
} | ||
|
||
.icon { | ||
padding-left: 20px; | ||
} |
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,47 @@ | ||
import React from 'react'; | ||
import { FormattedMessage } from 'react-intl'; | ||
import useVersion from 'hooks/useVersion'; | ||
import styles from './UpdateNotice.module.css'; | ||
import ButtonLayout from '../layout/ButtonLayout'; | ||
import Button from './Button'; | ||
import useForceUpdate from '../../hooks/useForceUpdate'; | ||
|
||
export default function UpdateNotice() { | ||
const forceUpdte = useForceUpdate(); | ||
const { hasUpdate, latest, updateCheck } = useVersion(); | ||
|
||
function handleViewClick() { | ||
location.href = 'https://github.com/mikecao/umami/releases'; | ||
updateCheck(); | ||
forceUpdte(); | ||
} | ||
|
||
function handleDismissClick() { | ||
updateCheck(); | ||
forceUpdte(); | ||
} | ||
|
||
if (!hasUpdate) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<div className={styles.notice}> | ||
<div className={styles.message}> | ||
<FormattedMessage | ||
id="message.new-version-available" | ||
defaultMessage="A new version of umami {version} is available!" | ||
values={{ version: `v${latest}` }} | ||
/> | ||
</div> | ||
<ButtonLayout> | ||
<Button size="xsmall" variant="action" onClick={handleViewClick}> | ||
<FormattedMessage id="button.view-details" defaultMessage="View details" /> | ||
</Button> | ||
<Button size="xsmall" onClick={handleDismissClick}> | ||
<FormattedMessage id="button.dismiss" defaultMessage="Dismiss" /> | ||
</Button> | ||
</ButtonLayout> | ||
</div> | ||
); | ||
} |
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,13 @@ | ||
.notice { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
padding-top: 10px; | ||
font-size: var(--font-size-small); | ||
font-weight: 600; | ||
} | ||
|
||
.message { | ||
text-align: center; | ||
margin-right: 20px; | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import React from 'react'; | ||
import classNames from 'classnames'; | ||
import styles from './Page.module.css'; | ||
|
||
export default function Page({ children }) { | ||
return <div className={styles.page}>{children}</div>; | ||
export default function Page({ className, children }) { | ||
return <div className={classNames(styles.page, className)}>{children}</div>; | ||
} |
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 |
---|---|---|
|
@@ -4,4 +4,5 @@ | |
align-items: center; | ||
align-content: center; | ||
min-height: 80px; | ||
align-self: stretch; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
.container { | ||
display: flex; | ||
flex-direction: column; | ||
align-self: stretch; | ||
} | ||
|
||
.title { | ||
|
Oops, something went wrong.