fix: initial commit
This commit is contained in:
10
example/.sassrc.js
Normal file
10
example/.sassrc.js
Normal file
@@ -0,0 +1,10 @@
|
||||
const path = require('path');
|
||||
|
||||
// Resolve ~tilda paths used in paragon to
|
||||
// node_modules. This is used to reference
|
||||
// bootstrap specifically.
|
||||
module.exports = {
|
||||
includePaths: [
|
||||
path.resolve(__dirname, '../node_modules'),
|
||||
],
|
||||
};
|
||||
12
example/index.html
Normal file
12
example/index.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="en-us">
|
||||
<head>
|
||||
<title>Example</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script src="./index.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
35
example/index.js
Normal file
35
example/index.js
Normal file
@@ -0,0 +1,35 @@
|
||||
import React from 'react';
|
||||
import { render } from 'react-dom';
|
||||
import { IntlProvider } from '@edx/frontend-i18n';
|
||||
import { AuthenticationContext } from '@edx/frontend-base';
|
||||
|
||||
import './index.scss';
|
||||
import SiteHeader from '../src/';
|
||||
|
||||
const App = () => (
|
||||
<div>
|
||||
<IntlProvider locale="en">
|
||||
<>
|
||||
<AuthenticationContext.Provider value={{
|
||||
userId: null,
|
||||
username: null,
|
||||
administrator: false,
|
||||
}}>
|
||||
<SiteHeader />
|
||||
</AuthenticationContext.Provider>
|
||||
<h5 className="mt-2 mb-5">Logged out state</h5>
|
||||
|
||||
<AuthenticationContext.Provider value={{
|
||||
userId: null,
|
||||
username: 'testuser',
|
||||
administrator: false,
|
||||
}}>
|
||||
<SiteHeader />
|
||||
</AuthenticationContext.Provider>
|
||||
<h5 className="mt-2">Logged in state</h5>
|
||||
</>
|
||||
</IntlProvider>
|
||||
</div>
|
||||
);
|
||||
|
||||
render(<App />, document.getElementById('root'));
|
||||
2
example/index.scss
Normal file
2
example/index.scss
Normal file
@@ -0,0 +1,2 @@
|
||||
@import "~@edx/paragon/scss/core/core.scss";
|
||||
@import '../src/index.scss';
|
||||
Reference in New Issue
Block a user