Skip to content

Commit f4540ac

Browse files
docs: add suport for t-rex-ui 1.3.0 (#981)
* Add suport for t-rex-ui 1.3.0 * trailing whiteline
1 parent af1b928 commit f4540ac

73 files changed

Lines changed: 12920 additions & 134 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/audiodocs/docs/core/base-audio-context.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ const buffer = await this.audioContext.decodeAudioData(data, 4800, 2, false);
318318
### `ContextState`
319319

320320
<details>
321+
<summary>Details</summary>
321322

322323
**Acceptable values:**
323324
- `suspended`

packages/audiodocs/docusaurus.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ const config = {
5757
},
5858
},
5959
],
60+
require.resolve('@swmansion/t-rex-ui/preset'),
6061
],
6162

6263
stylesheets: [

packages/audiodocs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@mui/material": "^7.1.0",
3434
"@react-native-community/slider": "^5.0.1",
3535
"@shopify/react-native-skia": "1.10.2",
36-
"@swmansion/t-rex-ui": "1.2.1",
36+
"@swmansion/t-rex-ui": "1.3.0",
3737
"@types/three": "^0.180.0",
3838
"@vercel/og": "^0.6.2",
3939
"babel-polyfill": "^6.26.0",
Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,37 @@
1-
import {
2-
ButtonStyling,
3-
BorderStyling,
4-
HomepageButton,
5-
} from '@swmansion/t-rex-ui/dist/components/HomepageButton';
6-
import styles from './styles.module.css';
1+
import { JSX, useEffect } from 'react';
2+
import {HireUsSection} from '@swmansion/t-rex-ui'
3+
import './styles.module.css';
74

8-
export const HireUsSection = ({
5+
export const HireUsSectionWrapper = ({
96
content,
107
href,
118
}: {
12-
content?: string;
9+
content?: string | JSX.Element;
1310
href: string;
1411
}) => {
15-
return (
16-
<div className={styles.hireUsSectionWrapper}>
17-
<div className={styles.hireUsTitleContainer}>
18-
<h2>
19-
We are <span>Software Mansion</span>
20-
</h2>
21-
</div>
22-
<p className={styles.hireUsSectionBody}>
23-
We’re a software company built around improving developer experience and bringing innovative clients' ideas to life. We're pushing boundaries and delivering high-performance solutions that scale.
24-
<br />< br />
25-
Need help integrating React Native Audio API into your project or want to discuss your ideas?
26-
</p>
27-
28-
<div className={styles.hireUsButton}>
29-
<HomepageButton
30-
href={href}
31-
title="Let's talk"
32-
target="_blank"
33-
backgroundStyling={ButtonStyling.SECTION}
34-
borderStyling={BorderStyling.SECTION}
35-
/>
36-
</div>
37-
</div>
12+
const resolvedContent = content || (
13+
<>
14+
We’re a software company built around improving developer experience and
15+
bringing innovative clients' ideas to life. We're pushing boundaries and
16+
delivering high-performance solutions that scale.
17+
<br />
18+
<br />
19+
Need help integrating React Native Audio API into your project or want to
20+
discuss your ideas?
21+
</>
3822
);
23+
24+
// TODO: Remove this hack after we add support for custom button text in the HireUsSection component
25+
// Optional TODO: Contribute to t-rex-ui to add support for custom button text and remove this hack
26+
useEffect(() => {
27+
const btn = document.querySelector("[class*='hireUsSection'] [class*='homepageButtonLink'] > [class*='homepageButton']");
28+
if (btn) {
29+
const textNode = Array.from(btn.childNodes).find(n => n.nodeType === Node.TEXT_NODE);
30+
if (textNode) {
31+
textNode.textContent = "Let's talk";
32+
}
33+
}
34+
}, []);
35+
36+
return <HireUsSection content={resolvedContent} href={href} />
3937
};
Lines changed: 5 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,14 @@
1-
.hireUsSectionWrapper {
2-
display: flex;
3-
flex-direction: column;
4-
align-items: center;
5-
gap: 2.5rem;
6-
margin-bottom: 16rem;
7-
margin-top: 6.5rem;
8-
}
9-
10-
@media (max-width: 996px) {
11-
.hireUsSectionWrapper {
12-
margin-top: 3.5rem;
13-
margin-bottom: 10rem;
14-
}
15-
}
16-
17-
@media (max-width: 768px) {
18-
.hireUsSectionWrapper {
19-
gap: 1.5rem;
20-
margin-top: 0;
21-
margin-bottom: 5rem !important;
22-
}
23-
.hireUsTitleContainer h2 {
24-
font-size: 42px !important;
25-
}
26-
.hireUsSectionBody {
27-
font-size: 20px !important;
28-
}
29-
}
30-
311
@media (max-width: 420px) {
32-
.hireUsSectionWrapper {
33-
margin-top: 0;
34-
margin-bottom: 4rem !important;
2+
[class*='hireUsSectionBody'] {
3+
font-size: 18px !important;
354
}
365
}
376

38-
.hireUsTitleContainer {
39-
display: flex;
40-
flex-direction: row;
41-
gap: 1rem;
42-
justify-content: center;
43-
align-items: center;
44-
}
45-
46-
.hireUsTitleContainer h2 {
47-
text-align: center;
48-
font-size: 64px;
49-
font-weight: 700;
50-
}
51-
52-
.hireUsTitleContainer h2 > span {
53-
color: var(--swm-hire-us-section-title);
54-
}
55-
56-
[data-theme='dark'] .hireUsTitleContainer h2 > span {
57-
color: var(--swm-hire-us-section-title);
58-
}
59-
60-
.hireUsSectionBody {
61-
font-size: 20px;
62-
text-wrap: balance;
63-
text-align: center;
64-
font-weight: 400;
7+
[class*='hireUsSectionBody'] {
8+
font-size: 20px !important;
659
color: var(--swm-navy-light-80);
6610
}
6711

68-
[data-theme='dark'] .hireUsSectionBody {
12+
[data-theme='dark'] [class*='hireUsSectionBody'] {
6913
color: var(--swm-navy-dark-40);
7014
}
71-
72-
73-
@media (max-width: 420px) {
74-
.hireUsSectionBody {
75-
font-size: 18px !important;
76-
}
77-
}

packages/audiodocs/src/css/colors.css

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,23 @@
304304
--swm-compatibility-supported-background: var(--swm-green-light-80);
305305
--swm-compatibility-not-supported-background: var(--swm-red-light-80);
306306
--swm-compatibility-text-color: var(--swm-white);
307+
308+
/* Markdown copy button */
309+
--swm-markdown-copy-button-color: var(--swm-navy-light-100);
310+
--swm-markdown-copy-button-border-color: var(--swm-navy-light-100);
311+
--swm-markdown-copy-button-background-hover: var(--swm-navy-light-10);
312+
--swm-markdown-copy-button-item-color: var(--swm-navy-light-40);
313+
--swm-markdown-copy-button-item-background: var(--swm-background);
314+
--swm-markdown-copy-button-item-background-hover: var(
315+
--ifm-color-emphasis-100
316+
);
317+
--swm-markdown-copy-button-item-color-hover: var(--swm-navy-light-100);
318+
319+
/* Badges */
320+
--swm-platform-badge-background: var(--swm-green-dark-120);
321+
--swm-platform-badge-color: var(--swm-off-white);
322+
--swm-available-from-badge-background: var(--swm-yellow-dark-120);
323+
--swm-available-from-badge-color: var(--swm-off-white);
307324
}
308325

309326
:root[data-theme='dark'] {
@@ -478,6 +495,23 @@
478495
--swm-compatibility-supported-background: var(--swm-green-dark-120);
479496
--swm-compatibility-not-supported-background: var(--swm-red-dark-120);
480497
--swm-compatibility-text-color: var(--swm-navy-dark-20);
498+
499+
/* Markdown copy button */
500+
--swm-markdown-copy-button-color: var(--swm-navy-light-40);
501+
--swm-markdown-copy-button-border-color: var(--swm-navy-light-40);
502+
--swm-markdown-copy-button-background-hover: var(--ifm-color-emphasis-100);
503+
--swm-markdown-copy-button-item-color: var(--swm-navy-light-40);
504+
--swm-markdown-copy-button-item-background: var(--swm-background);
505+
--swm-markdown-copy-button-item-background-hover: var(
506+
--ifm-color-emphasis-100
507+
);
508+
--swm-markdown-copy-button-item-color-hover: var(--swm-off-white);
509+
510+
/* Badges */
511+
--swm-platform-badge-background: var(--swm-green-dark-120);
512+
--swm-platform-badge-color: var(--swm-off-white);
513+
--swm-available-from-badge-background: var(--swm-yellow-dark-120);
514+
--swm-available-from-badge-color: var(--swm-off-white);
481515
}
482516

483517
code {

packages/audiodocs/src/css/overrides.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,3 +231,7 @@ button[class*='DocSearch-Button'] {
231231
border-collapse: collapse;
232232
box-sizing: border-box;
233233
}
234+
235+
[class*='headerWithBadges'] {
236+
align-items: baseline;
237+
}

packages/audiodocs/src/pages/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import LandingWidget from '@site/src/components/LandingWidget';
1111
import LandingFeatures from '@site/src/components/LandingFeatures';
1212
// import LandingExamples from '@site/src/components/LandingExamples';
1313
import FooterBackground from '@site/src/components/FooterBackground';
14-
import { HireUsSection } from '@site/src/components/HireUsSection';
14+
import { HireUsSectionWrapper } from '@site/src/components/HireUsSection';
1515

1616
import styles from './styles.module.css';
1717
import AudioManager from '../audio/AudioManager';
@@ -48,7 +48,7 @@ function Home() {
4848
<Spacer.V size="12rem" className={styles.hideOnMobile} />
4949
<Spacer.V size="6rem" className={styles.visibleOnMobile} />
5050
<div className={styles.container}>
51-
<HireUsSection
51+
<HireUsSectionWrapper
5252
href={
5353
'https://swmansion.com/contact/projects?utm_source=gesture-handler&utm_medium=docs'
5454
}

packages/audiodocs/src/theme/Admonition/index.jsx

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/audiodocs/src/theme/DocCard/index.jsx

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)