summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-core/src/components/Import.js
blob: 057ef7a52d8d6f2539ddfc9d19a22cf14129b679 (plain)
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
const React = require('react');
const Head = require('react-helmet');
const ReactRedux = require('react-redux');

const ImportLink = ReactRedux.connect((state, {rel, href}) => {
    href = href; // TODO: resolve using current page

    return {
        link: [
            {
                rel,
                href
            }
        ]
    };
})(Head);

const ImportScript = ReactRedux.connect((state, {type, src}) => {
    src = src; // TODO: resolve using current page

    return {
        script: [
            {
                type,
                src
            }
        ]
    };
})(Head);

const ImportCSS = props => <ImportLink rel="stylesheet" {...props} />;

module.exports = {
    ImportLink,
    ImportScript,
    ImportCSS
};