Skip to content

Commit

Permalink
style improvements to BOS (#1485)
Browse files Browse the repository at this point in the history
  • Loading branch information
gagdiez authored Sep 7, 2023
1 parent fc2568f commit ec946e1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/2.develop/integrate/welcome.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Welcome! Here you will find documentation on how to build Web3 applications usin
<div class="container">
<div class="row">
<div class="col col--3">
<a href="/bos">
<a href="/bos/overview">
<div class="card">
<div class="card__image">
<img src={require("@site/static/docs/assets/welcome-pages/bos-big.png").default} alt="Multichain" />
Expand Down
13 changes: 5 additions & 8 deletions website/src/components/social-widget.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import React from "react";
import BrowserOnly from '@docusaurus/BrowserOnly';

export function WidgetEditor({ children, id=1, height="160px", properties }) {
export function WidgetEditor({ children, id = 1, height = "160px", properties }) {
let props = "";
for(const prop in properties){
for (const prop in properties) {
props += `${prop}=${properties[prop]}`
}

const uri = "https://near.social/#/embed/zavodil.near/widget/remote-code?"+props;
const uri = "https://near.social/#/embed/zavodil.near/widget/remote-code?" + props;

const code = children.props.children.props.children;



return (
<BrowserOnly fallback={<div>Loading...</div>}>
{() => {
Expand Down Expand Up @@ -41,12 +39,11 @@ export function WidgetEditor({ children, id=1, height="160px", properties }) {
onChange={(newValue, event) => { document.getElementById(`ifm${id}`).src = `${uri}&code=${encodeURIComponent(newValue)}` }}
/>
</div>
<em> You can edit the code! </em>

<div class="code_iframe">
<h4>Preview</h4>
<h4 style={{ fontWeight: 0 }}> <b>Preview</b> <small> - Edit the code above! </small> </h4>
<hr class="preview-border" />
<iframe id={`ifm${id}`} src={`${uri}&code=${encodeURIComponent(code)}`} style={{height}}></iframe>
<iframe id={`ifm${id}`} src={`${uri}&code=${encodeURIComponent(code)}`} style={{ height }}></iframe>
</div>
</>

Expand Down
13 changes: 11 additions & 2 deletions website/src/css/customTheme.css
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,16 @@ img+em,
background-color: transparent;
}

/* Component Preview */

.code_iframe h4 {
margin: 0 !important;
}

.preview-border {
margin: 0.4rem 0 1rem 0;
}

/* Language selection Tabs*/
.file-tabs {
margin: 0px 0 -1rem 0rem;
Expand Down Expand Up @@ -1108,7 +1118,6 @@ iframe+em {
margin: 0.5em 0 0 0;
}


/* Widget Editor */
.monaco {
border-radius: 10px;
Expand All @@ -1120,7 +1129,7 @@ iframe+em {
border-radius: 10px;
border: 1px solid #e6e6e6;
padding: 1rem;
margin-bottom: 3rem;
margin: 1rem 0 2rem 0;
overflow: hidden;
}

Expand Down

0 comments on commit ec946e1

Please sign in to comment.