-
Notifications
You must be signed in to change notification settings - Fork 101
/
codepen-example.js
60 lines (52 loc) · 1.44 KB
/
codepen-example.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import React, {Component} from 'react';
import Container from 'components/Container';
import Layout from 'components/Layout';
import {colors} from 'theme';
// Copied over styles from ButtonLink for the submit btn
const primaryStyle = {
backgroundColor: colors.brand,
color: colors.black,
padding: '10px 25px',
whiteSpace: 'nowrap',
transition: 'background-color 0.2s ease-out',
outline: 0,
border: 'none',
cursor: 'pointer',
':hover': {
backgroundColor: colors.white,
},
display: 'inline-block',
fontSize: 16,
};
class CodepenExample extends Component {
componentDidMount() {
this.codepenForm.submit();
}
render() {
const {location, pageContext} = this.props;
const {action, payload} = pageContext;
return (
<Layout location={location}>
<Container>
<h1>إعادة توجيه نحو منصة Codepen...</h1>
<form
style={{paddingBottom: '50px'}}
ref={form => {
this.codepenForm = form;
}}
action={action}
method="POST">
<input type="hidden" name="data" value={payload} />
<p>
لا نقوم بإعادة توجيهك تلقائيا؟
<br />
<br />
<input style={primaryStyle} type="submit" value="إضغط هنا" />
</p>
</form>
</Container>
</Layout>
);
}
}
export default CodepenExample;