Skip to content

Commit

Permalink
fix: #1218 update site-builder style & component name
Browse files Browse the repository at this point in the history
  • Loading branch information
Cuong Vu committed May 28, 2020
1 parent 317d47d commit dc6b191
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const initializeBookAValuationComponent = editor => {

const initWidget = () => {
container.innerHTML = ''
new window.ReapitAppointmentBookingComponent({
new window.ReapitBookValuationWidget({
theme: {
baseBackgroundColor: '#fff',
basefontSize: '16px',
Expand All @@ -64,14 +64,14 @@ export const initializeBookAValuationComponent = editor => {
})
}

if (!window.ReapitAppointmentBookingComponent) {
if (!window.ReapitBookValuationWidget) {
const styles = document.createElement('link')
styles.href = 'https://web-components.reapit.cloud/appointment-bookings.css'
styles.href = 'https://web-components.reapit.cloud/book-valuation-widget.css'
styles.rel = 'stylesheet'
document.head.appendChild(styles)

const script = document.createElement('script')
script.src = 'https://web-components.reapit.cloud/appointment-bookings.js'
script.src = 'https://web-components.reapit.cloud/book-valuation-widget.js'
script.async = true
script.defer = true
script.onload = initWidget
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const initializePropertyDetailComponent = editor => {

const initWidget = () => {
container.innerHTML = ''
new window.ReapitPropertyDetailComponent({
new window.ReapitPropertyDetailWidget({
theme: {
baseBackgroundColor: '#fff',
basefontSize: '16px',
Expand All @@ -62,14 +62,14 @@ export const initializePropertyDetailComponent = editor => {
})
}

if (!window.ReapitPropertyDetailComponent) {
if (!window.ReapitPropertyDetailWidget) {
const styles = document.createElement('link')
styles.href = 'https://web-components.reapit.cloud/property-detail.css'
styles.href = 'https://web-components.reapit.cloud/property-detail-widget.css'
styles.rel = 'stylesheet'
document.head.appendChild(styles)

const script = document.createElement('script')
script.src = 'https://web-components.reapit.cloud/property-detail.js'
script.src = 'https://web-components.reapit.cloud/property-detail-widget.js'
script.async = true
script.defer = true
script.onload = initWidget
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const initializeSearchWidgetComponent = editor => {

const initWidget = () => {
container.innerHTML = ''
new window.ReapitSearchWidgetComponent({
new window.ReapitSearchWidget({
theme: {
baseBackgroundColor: '#fff',
basefontSize: '16px',
Expand All @@ -62,7 +62,7 @@ export const initializeSearchWidgetComponent = editor => {
})
}

if (!window.ReapitSearchWidgetComponent) {
if (!window.ReapitSearchWidget) {
const styles = document.createElement('link')
styles.href = 'https://web-components.reapit.cloud/search-widget.css'
styles.rel = 'stylesheet'
Expand Down
9 changes: 7 additions & 2 deletions packages/site-builder/src/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ html {
box-sizing: content-box !important;
}

#root {
height: 100%;
}

/* Class names prefixes */
$prefix: 'gjs-' !default;

Expand All @@ -38,7 +42,8 @@ $quaternaryColor: #7bc9eb;
$fontName: 'Open Sans', Arial, Helvetica, sans-serif;

.#{$prefix} {
@each $cnum, $ccol in (one, $primaryColor), (two, $secondaryColor), (three, $tertiaryColor), (four, $quaternaryColor) {
@each $cnum, $ccol in (one, $primaryColor), (two, $secondaryColor), (three, $tertiaryColor), (four, $quaternaryColor)
{
&#{$cnum} {
&-bg {
background-color: $ccol;
Expand All @@ -55,5 +60,5 @@ $fontName: 'Open Sans', Arial, Helvetica, sans-serif;
}
}

@import './vendor/grapesjs/main.scss';

@import "./vendor/grapesjs/main.scss";
1 change: 1 addition & 0 deletions packages/site-builder/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.
1 change: 1 addition & 0 deletions packages/site-builder/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.
1 change: 1 addition & 0 deletions packages/site-builder/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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions packages/site-builder/src/types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ declare global {
reapit: {
config: Config
}
ReapitSearchWidgetComponent: any
ReapitPropertyDetailComponent: any
ReapitAppointmentBookingComponent: any
ReapitSearchWidget: any
ReapitPropertyDetailWidget: any
ReapitBookValuationWidget: any
}
}

0 comments on commit dc6b191

Please sign in to comment.