Skip to content

Commit

Permalink
Move model overview CTA and update title
Browse files Browse the repository at this point in the history
  • Loading branch information
steverydz committed Aug 8, 2023
1 parent 8f46b34 commit a6cae89
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 35 deletions.
52 changes: 29 additions & 23 deletions static/js/brand-store/components/Model/Model.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,15 @@ function Model() {
<div className="p-panel">
<div className="p-panel__content">
<div className="u-fixed-width">
<Link to={`/admin/${id}/models`}>&lsaquo;&nbsp;Models</Link>
</div>
<div className="u-fixed-width">
<h1>{model_id}</h1>
<nav className="p-breadcrumbs" aria-label="Breadcrumbs">
<ol className="p-breadcrumbs__items u-no-margin--bottom">
<li className="p-breadcrumbs__item">
<Link to={`/admin/${id}/models`}>&lsaquo;&nbsp;Models</Link>
</li>
<li className="p-breadcrumbs__item">{model_id}</li>
</ol>
</nav>
<h1 className="u-off-screen">{model_id}</h1>
</div>
<div className="u-fixed-width">
<ModelNav sectionName="overview" />
Expand Down Expand Up @@ -114,11 +119,31 @@ function Model() {
</Notification>
</div>
)}
<div className="u-fixed-width u-align--right">
<Button
type="button"
onClick={() => {
setNewApiKey("");
}}
>
Revert
</Button>
<Button
type="submit"
appearance="positive"
className="u-no-margin--right"
disabled={!newApiKey}
form="save-model-form"
>
Save
</Button>
</div>
<Row>
<Col size={8}>
{currentModel && (
<form
className="p-form p-form--stacked"
id="save-model-form"
onSubmit={(event) => {
event.preventDefault();
mutation.mutate(newApiKey);
Expand Down Expand Up @@ -236,25 +261,6 @@ function Model() {
</Row>
</div>
)}
<hr style={{ marginTop: "1rem", marginBottom: "1rem" }} />
<div className="u-align--right">
<Button
type="button"
onClick={() => {
setNewApiKey("");
}}
>
Revert
</Button>
<Button
type="submit"
appearance="positive"
className="u-no-margin--right"
disabled={!newApiKey}
>
Save
</Button>
</div>
</form>
)}
</Col>
Expand Down
13 changes: 9 additions & 4 deletions static/js/brand-store/components/Model/Policies.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,15 @@ function Policies() {
<div className="p-panel">
<div className="p-panel__content">
<div className="u-fixed-width">
<Link to={`/admin/${id}/models`}>&lsaquo;&nbsp;Models</Link>
</div>
<div className="u-fixed-width">
<h1>{model_id}</h1>
<nav className="p-breadcrumbs" aria-label="Breadcrumbs">
<ol className="p-breadcrumbs__items u-no-margin--bottom">
<li className="p-breadcrumbs__item">
<Link to={`/admin/${id}/models`}>&lsaquo;&nbsp;Models</Link>
</li>
<li className="p-breadcrumbs__item">{model_id}</li>
</ol>
</nav>
<h1 className="u-off-screen">{model_id}</h1>
</div>
<div className="u-fixed-width">
<ModelNav sectionName="policies" />
Expand Down
6 changes: 0 additions & 6 deletions static/sass/_snapcraft_p-breadcrumbs.scss

This file was deleted.

6 changes: 4 additions & 2 deletions static/sass/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ $color-social-icon-foreground: $color-light;
@include snapcraft-p-multiselect;
@import "patterns_first-snap-flow";
@include snapcraft-p-first-snap-flow;
@import "snapcraft_p-breadcrumbs";
@include snapcraft-p-breadcrumbs;
@import "snapcraft-publicise";
@include snapcraft-publicise;
@import "snapcraft-publisher";
Expand Down Expand Up @@ -455,3 +453,7 @@ code {
.p-navigation__row.is-full-width {
max-width: 100%;
}

.p-breadcrumbs__item:not(:first-of-type)::before {
margin-left: -0.5rem;
}

0 comments on commit a6cae89

Please sign in to comment.