Skip to content

Commit

Permalink
[google-maps-input] make buttons look the same as rest of studio
Browse files Browse the repository at this point in the history
  • Loading branch information
vicmeow authored and bjoerge committed Jun 23, 2020
1 parent 6b5f724 commit b2b133e
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions packages/@sanity/google-maps-input/src/GeopointInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import Button from 'part:@sanity/components/buttons/default'
import Dialog from 'part:@sanity/components/dialogs/default'
import Fieldset from 'part:@sanity/components/fieldsets/default'
import {PatchEvent, set, setIfMissing, unset} from 'part:@sanity/form-builder/patch-event'
import ButtonGrid from 'part:@sanity/components/buttons/button-grid'
import EditIcon from 'part:@sanity/base/edit-icon'
import styles from '../styles/GeopointInput.css'
import GeopointSelect from './GeopointSelect'
import GoogleMapsLoadProxy from './GoogleMapsLoadProxy'
Expand Down Expand Up @@ -141,13 +143,17 @@ class GeopointInput extends React.Component {
)}

<div className={styles.functions}>
<Button onClick={this.handleToggleModal}>{value ? 'Edit' : 'Set location'}</Button>

{value && (
<Button type="button" onClick={this.handleClear}>
Remove
<ButtonGrid>
<Button inverted onClick={this.handleToggleModal} icon={value && EditIcon}>
{value ? 'Edit' : 'Set location'}
</Button>
)}

{value && (
<Button color="danger" inverted type="button" onClick={this.handleClear}>
Remove
</Button>
)}
</ButtonGrid>
</div>

{this.state.modalOpen && (
Expand Down

0 comments on commit b2b133e

Please sign in to comment.