Refactoring regarding home page
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# Algorithm Visualizer
|
||||
> Algorithm Visualizer is an interactive online platform that visualizes algorithms from code. [Demo Video](https://youtu.be/1BixGs7Y-lw)
|
||||
> Algorithm Visualizer is an interactive online platform that visualizes algorithms from code.
|
||||
|
||||
[](https://gitter.im/algorithm-visualizer)
|
||||
[](https://github.com/algorithm-visualizer/algorithm-visualizer/graphs/contributors)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { CODE_JS, CODE_JAVA, CODE_CPP } from '/skeletons';
|
||||
import { CODE_CPP, CODE_JAVA, CODE_JS } from '/skeletons';
|
||||
|
||||
const languages = [{
|
||||
name: 'JavaScript',
|
||||
@@ -19,13 +19,7 @@ const languages = [{
|
||||
|
||||
const exts = languages.map(language => language.ext);
|
||||
|
||||
const us = {
|
||||
login: 'algorithm-visualizer',
|
||||
avatar_url: 'https://github.com/algorithm-visualizer.png',
|
||||
};
|
||||
|
||||
export {
|
||||
languages,
|
||||
exts,
|
||||
us,
|
||||
};
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { README_MD } from '/skeletons';
|
||||
|
||||
const classes = (...arr) => arr.filter(v => v).join(' ');
|
||||
|
||||
const distance = (a, b) => {
|
||||
@@ -25,7 +27,14 @@ const getFiles = current => {
|
||||
const { algorithm, scratchPaper } = current;
|
||||
if (algorithm) return algorithm.files;
|
||||
if (scratchPaper) return scratchPaper.files;
|
||||
return [];
|
||||
return [{
|
||||
name: 'README.md',
|
||||
content: README_MD,
|
||||
contributors: [{
|
||||
login: 'algorithm-visualizer',
|
||||
avatar_url: 'https://github.com/algorithm-visualizer.png',
|
||||
}],
|
||||
}];
|
||||
};
|
||||
|
||||
const getTitleArray = current => {
|
||||
|
||||
@@ -20,8 +20,8 @@ import {
|
||||
import { AlgorithmApi, GitHubApi } from '/apis';
|
||||
import { actions } from '/reducers';
|
||||
import { extension, getFiles, getTitleArray, handleError, refineGist } from '/common/util';
|
||||
import { exts, languages, us } from '/common/config';
|
||||
import { README_MD, SCRATCH_PAPER_MD } from '/skeletons';
|
||||
import { exts, languages } from '/common/config';
|
||||
import { SCRATCH_PAPER_MD } from '/skeletons';
|
||||
import styles from './stylesheet.scss';
|
||||
|
||||
loadProgressBar();
|
||||
@@ -168,15 +168,7 @@ class App extends React.Component {
|
||||
fetchPromise
|
||||
.catch(error => {
|
||||
if (error.message) handleError.bind(this)(error);
|
||||
this.props.setAlgorithm({
|
||||
categoryName: 'Algorithm Visualizer',
|
||||
algorithmName: 'Home',
|
||||
files: [{
|
||||
name: 'README.md',
|
||||
content: README_MD,
|
||||
contributors: [us],
|
||||
}],
|
||||
});
|
||||
this.props.setHome();
|
||||
})
|
||||
.finally(() => {
|
||||
const files = getFiles(this.props.current);
|
||||
@@ -272,8 +264,6 @@ class App extends React.Component {
|
||||
<Helmet>
|
||||
<title>{title}</title>
|
||||
<meta name="description" content={description} />
|
||||
<meta property="og:title" content={title} />
|
||||
<meta property="og:description" content={description} />
|
||||
</Helmet>
|
||||
<Header className={styles.header} onClickTitleBar={() => this.toggleNavigatorOpened()}
|
||||
navigatorOpened={navigatorOpened} loadScratchPapers={() => this.loadScratchPapers()}
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<meta name="theme-color" content="#393939">
|
||||
<title>Algorithm Visualizer</title>
|
||||
<meta name="description" content="Algorithm Visualizer is an interactive online platform that visualizes algorithms from code." />
|
||||
<meta property="og:image" content="https://raw.githubusercontent.com/algorithm-visualizer/algorithm-visualizer/master/branding/screenshot.png" />
|
||||
<meta property="og:site_name" content="Algorithm Visualizer" />
|
||||
<link rel="shortcut icon" href="/favicon.png" type="image/png">
|
||||
|
||||
Reference in New Issue
Block a user