Skip to content

Commit

Permalink
Merge pull request #8 from CybersecurityLuxembourg/validation
Browse files Browse the repository at this point in the history
Validation
  • Loading branch information
pparage authored May 31, 2024
2 parents f86e08a + 93a4532 commit ae490cd
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 21 deletions.
23 changes: 22 additions & 1 deletion src/component/bar/Menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,30 @@
width: 100%;
}

.Menu .top-right-bar button {
.Menu .top-right-bar .immediate {
margin: 16px auto;
width: fit-content;
box-sizing: border-box;

/* Auto layout */

flex-direction: row;
align-items: center;

padding: 16px 24px;
gap: 19px;
position: relative;
font-size: 16px;
line-height: 150%;
color: var(--text-neutral-0);

background: var(--accent-blue);
border: 1px solid var(--accent-blue) --primary-blue-100;

/* Button drop shadow */

box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
border-radius: 200px;
}

.Menu .split-bar {
Expand Down
13 changes: 5 additions & 8 deletions src/component/bar/Menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,11 @@ export default class Menu extends React.Component {

<div className="separator"/>
<div className="split-bar"/>

<button
className="red small"
href={getPrivateAppURL()}
onClick={() => this.props.history.push("support")}
>
IMMEDIATE SUPPORT
</button>
<a href="/support">
<button className="red small">
IMMEDIATE SUPPORT
</button>
</a>
</Nav>
</Navbar.Collapse>
</Navbar>
Expand Down
18 changes: 6 additions & 12 deletions src/utils/article.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,13 @@ export function getContentFromBlock(b) {
}
} else if (b.type === "FRAME") {
if (b.content !== null) {
// Sanitize and validate the content as a URL
const sanitizedContent = dompurify.sanitize(b.content.replace("&lt;", "<").replace("&gt;", ">"));

// Create the iframe element directly
el = <div className='content-media'>
<iframe
width="560"
height="315"
src={sanitizedContent}
frameBorder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowFullScreen
></iframe>
<div dangerouslySetInnerHTML={
{
__html:
b.content.replace("&lt;", "<").replace("&gt;", ">"),
}
} />
</div>;
}
}
Expand Down

0 comments on commit ae490cd

Please sign in to comment.