str_shorten
Version:
Shorten string by character length with word boundary supported
47 lines (41 loc) • 1.21 kB
JavaScript
/* eslint-disable global-require, import/no-unresolved, react/no-multi-comp */
import React from 'react';
import ReactDOM from 'react-dom';
import GithubCorner from 'react-github-corner';
import { Catalog, CodeSpecimen, ReactSpecimen, pageLoader } from 'catalog';
// Add your documentation imports here. These are available to
// React specimen. Do NOT pass React here as Catalog does that.
const documentationImports = {
strShorten: require('../src')
};
const pages = [
{
path: '/',
title: 'Introduction',
content: pageLoader(() => import('../README.md'))
}
];
// Catalog - logoSrc="../images/logo.png"
ReactDOM.render(
<div>
<GithubCorner
bannerColor="#fff"
direction="right"
height={80}
href="https://github.com/binhqd/str_shorten"
octoColor="#000"
width={80}
/>
<Catalog
imports={documentationImports}
pages={pages}
specimens={{
javascript: props => <CodeSpecimen {...props} lang="javascript" />,
js: props => <CodeSpecimen {...props} lang="javascript" />,
jsx: props => <ReactSpecimen {...props} />
}}
title="String Shorten"
/>
</div>,
document.getElementById('catalog')
);