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

fix: #1033 update config web component button #1365

Merged
merged 1 commit into from
May 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -67,47 +67,43 @@ exports[`WebComponentConfig Should match snapshot 1`] = `
}
>
<Component>
<Component>
<div
className="column "
<div>
<Component>
<h5
className="title is-5 "
id=""
>
Settings
</h5>
</Component>
<Component
fullWidth={true}
onClick={[Function]}
type="button"
variant="primary"
>
<Component>
<h6
className="title is-6 "
id=""
>
Settings
</h6>
</Component>
<Component
fullWidth={true}
<button
className="button is-primary is-fullwidth "
data-test=""
disabled={false}
onClick={[Function]}
type="button"
variant="primary"
>
<button
className="button is-primary is-fullwidth "
data-test=""
disabled={false}
onClick={[Function]}
type="button"
>
Configuration
</button>
</Component>
</div>
</Component>
<Component
afterClose={[Function]}
closeModal={[Function]}
type="BOOK_VIEWING"
>
Configuration
</button>
</Component>
<Component
afterClose={[Function]}
renderChildren={true}
visible={true}
/>
</Component>
closeModal={[Function]}
type="BOOK_VIEWING"
>
<Component
afterClose={[Function]}
renderChildren={true}
visible={true}
/>
</Component>
</div>
</Component>
</Provider>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import standAloneAppDetailStyles from '@/styles/blocks/standalone-app-detail.scs
import { renderCategory, renderDesktopIntegrationTypes } from '../client-app-detail/app-content'
import { DesktopIntegrationTypeModel } from '@reapit/foundations-ts-definitions'
import { AppDetailDataNotNull } from '@/reducers/client/app-detail'
import { GridItem, Button, H6 } from '@reapit/elements'
import { Button, H5 } from '@reapit/elements'
import { useDispatch, useSelector } from 'react-redux'
import { selectIsWebComponentOpen } from '@/selector/client'
import { clientCloseWebComponentConfig, clientOpenWebComponentConfig } from '@/actions/client'
import { Dispatch } from 'redux'
import WebComponentModal from '@/components/ui/web-component-config-modal'
import clientAppDetailStyles from '@/styles/pages/client-app-detail.scss?mod'

interface AsideProps {
appDetailData: AppDetailDataNotNull
Expand All @@ -29,8 +30,12 @@ export const Aside: React.FC<AsideProps> = ({ desktopIntegrationTypes, appDetail
<div className={standAloneAppDetailStyles.headerWithoutMargin}>
{renderDesktopIntegrationTypes(desktopIntegrationTypes)}
</div>
{isWebComponent && (
<div className={standAloneAppDetailStyles.headerWithoutMargin}>
<WebComponentConfig />
</div>
)}
</div>
{isWebComponent && <WebComponentConfig />}
</div>
)
}
Expand All @@ -49,20 +54,18 @@ export const WebComponentConfig = () => {
const handleToggleWebComponentModal = toggleWebComponentModal(dispatch)
const handleCloseWebComponentModal = closeWebComponentModal(dispatch)
return (
<>
<GridItem>
<H6>Settings</H6>
<Button type="button" variant="primary" fullWidth onClick={handleToggleWebComponentModal}>
Configuration
</Button>
</GridItem>
<div className={clientAppDetailStyles.gutter}>
<H5>Settings</H5>
<Button type="button" variant="primary" fullWidth onClick={handleToggleWebComponentModal}>
Configuration
</Button>
{isWebComponentOpen && (
<WebComponentModal
type="BOOK_VIEWING"
afterClose={handleCloseWebComponentModal}
closeModal={handleCloseWebComponentModal}
/>
)}
</>
</div>
)
}
2 changes: 1 addition & 1 deletion packages/marketplace/src/tests/badges/badge-branches.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/marketplace/src/tests/badges/badge-functions.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/marketplace/src/tests/badges/badge-lines.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/marketplace/src/tests/badges/badge-statements.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.