-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #326 from ably/jsx-to-tsx
[WEB-3649] Port JSX to TSX
- Loading branch information
Showing
81 changed files
with
2,372 additions
and
1,464 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ vendor | |
./reset | ||
preview | ||
node_modules | ||
public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React from "react"; | ||
|
||
import "../utils/syntax-highlighter.css"; | ||
import { | ||
highlightSnippet, | ||
registerDefaultLanguages, | ||
} from "../utils/syntax-highlighter"; | ||
import languagesRegistry from "../utils/syntax-highlighter-registry"; | ||
|
||
registerDefaultLanguages(languagesRegistry); | ||
|
||
type CodeProps = { | ||
language: string; | ||
snippet: string; | ||
textSize?: string; | ||
padding?: string; | ||
additionalCSS?: string; | ||
}; | ||
|
||
const Code = ({ | ||
language, | ||
snippet, | ||
textSize = "ui-text-code", | ||
padding = "p-32", | ||
additionalCSS = "", | ||
}: CodeProps) => { | ||
const HTMLraw = highlightSnippet(language, `${snippet}`.trim()) ?? ""; | ||
const className = `language-${language} ${textSize}`; | ||
|
||
return ( | ||
<div | ||
className={`hljs overflow-auto ${padding} ${additionalCSS}`} | ||
data-id="code" | ||
> | ||
<pre lang={language}> | ||
<code | ||
className={className} | ||
dangerouslySetInnerHTML={{ __html: HTMLraw }} | ||
/> | ||
</pre> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Code; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import React, { useEffect } from "react"; | ||
|
||
import Icon from "../Icon/component.tsx"; | ||
import _absUrl from "../url-base.js"; | ||
import toggleChatWidget from "../hubspot-chat-toggle"; | ||
import "./component.css"; | ||
|
||
type ContactFooterProps = { | ||
urlBase: string; | ||
}; | ||
|
||
const ContactFooter = ({ urlBase }: ContactFooterProps) => { | ||
useEffect(() => toggleChatWidget({ dataId: "contact-footer" }), []); | ||
const absUrl = (path) => _absUrl(path, urlBase); | ||
|
||
return ( | ||
<div | ||
className="ui-contact-footer font-sans antialiased" | ||
data-id="contact-footer" | ||
> | ||
<div className="w-full bp-lg max-w-screen-xl mx-auto py-64 grid grid-cols-1 md:grid-cols-3 ui-grid-gap ui-grid-px"> | ||
<div className="ui-contact-footer-box"> | ||
<Icon | ||
name="icon-display-live-chat" | ||
size="3rem" | ||
additionalCSS="block mb-16" | ||
/> | ||
<div> | ||
<div className="ui-text-h3 mb-24">Live Chat</div> | ||
<p className="ui-text-p1"> | ||
Reach out team of experts over chat powered by Ably. | ||
</p> | ||
</div> | ||
<button | ||
type="button" | ||
className="ui-btn-secondary self-start mt-16" | ||
disabled | ||
data-id="open-chat-widget" | ||
data-enabled-label="Start a live chat" | ||
data-disabled-label="Live chat unavailable" | ||
> | ||
Live chat unavailable | ||
</button> | ||
</div> | ||
|
||
<div className="ui-contact-footer-box"> | ||
<Icon | ||
name="icon-display-call-mobile" | ||
size="3rem" | ||
additionalCSS="block mb-16" | ||
/> | ||
<div className="flex-grow"> | ||
<div className="ui-text-h3 mb-24">Call us</div> | ||
<p className="ui-text-p1"> | ||
<span className="block"> | ||
<strong className="font-bold">+1 877 434 5287</strong> (USA, | ||
toll free) | ||
</span> | ||
<span className="block"> | ||
<strong className="font-bold">+44 20 3318 4689</strong> (UK) | ||
</span> | ||
</p> | ||
</div> | ||
</div> | ||
|
||
<div className="ui-contact-footer-box"> | ||
<Icon | ||
name="icon-display-tech-account-comms" | ||
size="3rem" | ||
additionalCSS="block mb-16" | ||
/> | ||
<div> | ||
<div className="ui-text-h3 mb-24"> | ||
Technical and account support | ||
</div> | ||
<p className="ui-text-p1"> | ||
We're standing by to help with any questions or code. | ||
</p> | ||
</div> | ||
<a | ||
className="ui-btn-secondary self-start p-btn mt-16" | ||
href={absUrl("/support")} | ||
> | ||
Get support now | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ContactFooter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.