Skip to content

Commit

Permalink
Add "show commit" button in History view #970
Browse files Browse the repository at this point in the history
  • Loading branch information
joepio committed Sep 16, 2024
1 parent 136dd90 commit 3c56d1a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
4 changes: 4 additions & 0 deletions browser/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

This changelog covers all five packages, as they are (for now) updated as a whole

## UNRELEASED

- #970 Add "show commit" button in History view

## v0.39.0

### Atomic Browser
Expand Down
21 changes: 17 additions & 4 deletions browser/data-browser/src/routes/History/HistoryDesktopView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import { HistoryViewProps } from './HistoryViewProps';
import { styled } from 'styled-components';
import { Button } from '../../components/Button';
import { Card } from '../../components/Card';
import { Column } from '../../components/Row';
import { Column, Row } from '../../components/Row';
import { Title } from '../../components/Title';
import { ResourceCardDefault } from '../../views/Card/ResourceCard';
import { VersionTitle } from './VersionTitle';
import { VersionScroller } from './VersionScroller';
import { useNavigateWithTransition } from '../../hooks/useNavigateWithTransition';
import { constructOpenURL } from '../../helpers/navigation';

export function HistoryDesktopView({
resource,
Expand All @@ -18,6 +20,8 @@ export function HistoryDesktopView({
onSelectVersion,
onVersionAccept,
}: HistoryViewProps) {
const navigate = useNavigateWithTransition();

return (
<>
<CurrentItem>
Expand All @@ -29,9 +33,18 @@ export function HistoryDesktopView({
<StyledCard>
<ResourceCardDefault resource={selectedVersion.resource} />
</StyledCard>
<Button onClick={onVersionAccept} disabled={isCurrentVersion}>
Make current version
</Button>
<Row>
<Button onClick={onVersionAccept} disabled={isCurrentVersion}>
Make current version
</Button>
<Button
onClick={() =>
navigate(constructOpenURL(selectedVersion.commit.id!))
}
>
Show Commit
</Button>
</Row>
</>
)}
</Column>
Expand Down

0 comments on commit 3c56d1a

Please sign in to comment.