Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification when an update is available #238

Open
wants to merge 5 commits into
base: v0.22.0-old
Choose a base branch
from
Open
Changes from 1 commit
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
23 changes: 12 additions & 11 deletions src/components/sidenav/Sidenav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const Sidenav = (props) => {
}

const isUpdateAvailable = scLatestVersion && scLatestVersion !== version

return (
<div className="sidenav-container">
<div className={showSidenav ? 'overlay' : 'no-overlay'} onClick={() => store.dispatch(set("uiState.showSidenav", false))}></div>
Expand Down Expand Up @@ -120,7 +120,7 @@ const Sidenav = (props) => {
</Link>
</div>
{isUpdateAvailable ? <React.Fragment>
Copy link
Contributor

Choose a reason for hiding this comment

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

no need for ternary operator
{isUpdateAvailable && ...updateDiv}
< div >
< popover >...ui version</ popover >
...sc version
< /div >

<div style={{ backgroundColor: "#D2E0FF", padding: 16}}>
<div style={{ backgroundColor: "#D2E0FF", padding: 16 }}>
Upgrade to v{scLatestVersion} <Button type="primary" ghost style={{ marginLeft: 9 }}>Update</Button>
Copy link
Contributor

Choose a reason for hiding this comment

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

what happens onClick?

</div>
<div style={{ margin: "10px 0px 20px 9px" }}>
Expand All @@ -129,15 +129,16 @@ const Sidenav = (props) => {
</Popover>
</div>
</React.Fragment> : <div className="sidenav-version">
<InfoCircleOutlined style={{ fontSize: "20px", fontWeight: "700" }} />
<div className="sidenav-version-content">
<Space direction="vertical" size={4}>
<Typography.Text>SC Version - v{version}</Typography.Text>
<Typography.Text>UI Version - v{uiVersion}</Typography.Text>
<Typography.Text type="secondary">{planName}</Typography.Text>
</Space>
</div>
</div>}
<Popover placement="right" content={`UI Version - v${uiVersion}`}>
<InfoCircleOutlined style={{ fontSize: "20px", fontWeight: "700", cursor: "pointer" }} />
</Popover>
<div className="sidenav-version-content">
<Space direction="vertical" size={4}>
<Typography.Text>SC Version - v{version}</Typography.Text>
<Typography.Text type="secondary">{planName}</Typography.Text>
</Space>
</div>
</div>}
</div>
</div>
);
Expand Down