Skip to content

Commit 03b6c5d

Browse files
Created a Video component and updated the code with new component. (#180)
* Video component and update everywhere with it * fixed an error with video component * Added Vieo and difficult to MDXLayout file and updated Video name * Add `youtube` prop to `VideoEmbed` component * Run Prettier Co-authored-by: Benoît Rouleau <benoit.rouleau@icloud.com>
1 parent 56455e2 commit 03b6c5d

Some content is hidden

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

53 files changed

+77
-404
lines changed

components/VideoEmbed.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { HTMLAttributes } from 'react'
2+
3+
export type VideoProps = (
4+
| {
5+
/** Video embed URL. */
6+
src: string
7+
youtube?: never
8+
}
9+
| {
10+
/** YouTube video ID. */
11+
youtube: string
12+
src?: never
13+
}
14+
) &
15+
HTMLAttributes<HTMLElement>
16+
17+
export const VideoEmbed = ({ src, youtube, ...props }: VideoProps) => {
18+
return (
19+
<figure sx={{ paddingBottom: `${100 / (16 / 9)}%` }} {...props}>
20+
<iframe
21+
src={src ?? `https://www.youtube.com/embed/${youtube}`}
22+
allowFullScreen
23+
sx={{ position: 'absolute', left: 0, top: 0, width: '100%', height: '100%' }}
24+
/>
25+
</figure>
26+
)
27+
}

components/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ export * from './List'
1010
export * from './NavTree'
1111
export * from './Paragraph'
1212
export * from './Table'
13+
export * from './VideoEmbed'

layout/MDXLayout.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ import {
2626
ListUnordered,
2727
Paragraph,
2828
Table,
29+
VideoEmbed,
30+
Difficulty,
2931
} from '@/components'
3032
import { useI18n } from '@/i18n'
3133
import { NavItemGroup } from '@/navigation'
@@ -47,6 +49,8 @@ const mdxComponents = {
4749
ul: ListUnordered,
4850
p: Paragraph,
4951
table: Table,
52+
VideoEmbed,
53+
Difficulty,
5054
}
5155

5256
const mdxStyles = {
@@ -56,16 +60,6 @@ const mdxStyles = {
5660
display: 'block',
5761
textAlign: 'center',
5862
},
59-
'.video-container': {
60-
paddingBottom: `${100 / (16 / 9)}%`,
61-
},
62-
'.video-iframe': {
63-
position: 'absolute',
64-
left: 0,
65-
top: 0,
66-
width: '100%',
67-
height: '100%',
68-
},
6963
} as ThemeUIStyleObject
7064

7165
export type MDXLayoutProps = PropsWithChildren<

pages/ar/cookbook/migrating-a-subgraph.mdx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,7 @@ _بينما تتم هذه الآلية حاليا على الشبكة ، ينا
147147

148148
إذا كنت لا تزال في حيرة من أمرك ، فلا تخف! راجع المصادر التالية أو شاهد الفيديو الخاص بنا حول ترحيل الـ subgraphs إلى الشبكة اللامركزية أدناه:
149149

150-
<figure className="video-container">
151-
<iframe
152-
className="video-iframe"
153-
src="https://www.youtube.com/embed/CzdQ3dFFrjo"
154-
title="مشغل فيديو يوتيوب"
155-
frameBorder="0"
156-
allowFullScreen
157-
></iframe>
158-
</figure>
150+
<VideoEmbed youtube="CzdQ3dFFrjo" />
159151

160152
- [عقود شبكة The Graph](https://github.com/graphprotocol/contracts)
161153
- [ عقد التنسيق](https://github.com/graphprotocol/contracts/blob/dev/contracts/curation/Curation.sol) - العقد الأساسي الذي تلتف حوله GNS

pages/ar/deploying/subgraph-studio.mdx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,7 @@ title: كيفية استخدام Subgraph Studio
6666

6767
لقد نجحت في الوصول إلى هذا الحد - تهانينا! نشر الـ subgraph يعني أنه تم إنشاء IPFS hash عند نشرك لـ subgraph ضمن CLI وتخزينه في عقود Ethereum الذكية للشبكة. ولنشر الـ subgraph الخاص بك بنجاح ، ستحتاج إلى اتباع الخطوات التالية الموجزة في هذه [ المدونة ](https://thegraph.com/blog/building-with-subgraph-studio). راجع الفيديو أدناه أيضًا:
6868

69-
<figure className="video-container">
70-
<iframe
71-
className="video-iframe"
72-
src="https://www.youtube.com/embed/HfDgC2oNnwo"
73-
title="مشغل فيديو يوتيوب"
74-
frameBorder="0"
75-
allowFullScreen
76-
></iframe>
77-
</figure>
69+
<VideoEmbed youtube="HfDgC2oNnwo" />
7870

7971
تذكر ، أثناء تقدمك في تدفق النشر ، ستتمكن من الدفع(push) إما إلى mainnet أو Rinkeby ، وهي testnet التي ندعمها. إذا كنت مطور subgraph لأول مرة ، فنحن نقترح بشدة أن تبدأ بالنشر على Rinkeby ، وهو مجاني. سيسمح لك ذلك بمعرفة كيفية عمل الـ subgraph في The Graph Explorer وسيسمح لك باختبار عناصر التنسيق.
8072

pages/ar/network/curating.mdx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,4 @@ title: (التنسيق) curating
9393

9494
لازلت مشوشا؟ راجع فيديو دليل التنسيق أدناه:
9595

96-
<figure className="video-container">
97-
<iframe
98-
className="video-iframe"
99-
src="https://www.youtube.com/embed/VytTEcf0dxQ"
100-
title="مشغل فيديو يوتيوب"
101-
frameBorder="0"
102-
allowFullScreen
103-
></iframe>
104-
</figure>
96+
<VideoEmbed youtube="VytTEcf0dxQ" />

pages/ar/network/delegating.mdx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,4 @@ At times, attempts to delegate to indexers via MetaMask can fail and result in p
9191

9292
This guide provides a full review of this document, and how to consider everything in this document while interacting with the UI.
9393

94-
<figure className="video-container">
95-
<iframe
96-
className="video-iframe"
97-
src="https://www.youtube.com/embed/2G7S2gdURdc"
98-
title="مشغل فيديو يوتيوب"
99-
frameBorder="0"
100-
allowFullScreen
101-
></iframe>
102-
</figure>
94+
<VideoEmbed youtube="2G7S2gdURdc" />

pages/ar/network/explorer.mdx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,7 @@ title: مستكشف
44

55
مرحبا بك في مستكشف Graph ، أو كما نحب أن نسميها ، بوابتك اللامركزية في عالم subgraphs وبيانات الشبكة. 👩🏽‍🚀 مستكشف TheGraph يتكون من عدة اجزاء حيث يمكنك التفاعل مع مطوري Subgraphs الاخرين ، ومطوري dApp ،والمنسقين والمفهرسين، والمفوضين. للحصول على نظرة عامة حول the Graph Explorer، راجع الفيديو أدناه (أو تابع القراءة أدناه):
66

7-
<figure className="video-container">
8-
<iframe
9-
className="video-iframe"
10-
src="https://www.youtube.com/embed/u224xf7rEBY"
11-
title="مشغل فيديو يوتيوب"
12-
frameBorder="0"
13-
allowFullScreen
14-
></iframe>
15-
</figure>
7+
<VideoEmbed youtube="u224xf7rEBY" />
168

179
## Subgraphs
1810

pages/ar/network/indexing.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
title: فهرسة (indexing)
33
---
44

5-
import { Difficulty } from '@/components'
6-
75
المفهرسون ( Indexers) هم مشغلي العقد (node) في شبكة TheGraph ويقومون ب staking لتوكن (GRT) من أجل توفير خدمات الفهرسة ( indexing) والاستعلام. المفهرسون(Indexers) يحصلون على رسوم الاستعلام ومكافآت الفهرسة وذلك مقابل خدماتهم. وأيضا يكسبون من مجموعة الخصومات (Rebate Pool) والتي تتم مشاركتها مع جميع المساهمين في الشبكة بما يتناسب مع عملهم ، وفقا ل Cobbs-Douglas Rebate Function.
86

97
يخضع GRT المخزن في البروتوكول لفترة إذابة thawing period وقد يتم شطبه إذا كان المفهرسون ضارون ويقدمون بيانات غير صحيحة للتطبيقات أو إذا قاموا بالفهرسة بشكل غير صحيح. المفهرسون يتم تفويضهم من قبل المفوضين وذلك للمساهمه في الشبكة.

pages/ar/querying/billing.mdx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,7 @@ title: الفوترة على Subgraph Studio
3939

4040
للحصول على عرض توضيحي سريع لكيفية عمل الفوترة في Subgraph Studio ، راجع الفيديو أدناه:
4141

42-
<figure className="video-container">
43-
<iframe
44-
className="video-iframe"
45-
src="https://www.youtube.com/embed/UrfIpm-Vlgs"
46-
title="مشغل فيديو يوتيوب"
47-
frameBorder="0"
48-
allowFullScreen
49-
></iframe>
50-
</figure>
42+
<VideoEmbed youtube="UrfIpm-Vlgs" />
5143

5244
### مستخدمو Multisig
5345

0 commit comments

Comments
 (0)