Skip to content

Commit

Permalink
docs(:pencil:) general updates
Browse files Browse the repository at this point in the history
- Adding PWA for doc site
- General PG updates
- Enabling i18n section with example
  • Loading branch information
atomicpages committed Sep 10, 2020
1 parent 01bc2f5 commit c9d3d67
Show file tree
Hide file tree
Showing 13 changed files with 731 additions and 153 deletions.
14 changes: 0 additions & 14 deletions docs/docs/main-concepts/i18n.md

This file was deleted.

26 changes: 26 additions & 0 deletions docs/docs/main-concepts/i18n.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
id: internationalization
title: Internationalization
---

import '@djthoms/pretty-checkbox/src/rtl.scss';

PCR doesn't contain any locale-specific strings that are rendered in the browser. Since you, the super awesome user of PCR, provides all the content, it seamlessly integrates into your i18n/l10n/g11n solution :smile:

## RTL Usage

PCR RTL usage requires no extra config for support; however, you **do** need to import one extra file from `@djthomps/pretty-checkbox`:

```js title="index.js"
import '@djthoms/pretty-checkbox/src/pretty-checkbox.scss';
import '@djthoms/pretty-checkbox/src/rtl.scss';
```

In the example, below we're using the `direction` property to achiev RTL direction,
but in most cases you'd add the `dir` attribute to the `html` tag directly.

```jsx live
<div style={{ direction: 'rtl' }}>
<Checkbox>مرحبا</Checkbox>
</div>
```
26 changes: 25 additions & 1 deletion docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
organizationName: 'atomicpages', // Usually your GitHub org/user name.
projectName: 'pretty-checkbox-react', // Usually your repo name.
stylesheets: [
'https://unpkg.com/@djthoms/pretty-checkbox@3.0.4/dist/pretty-checkbox.min.css',
'https://unpkg.com/@djthoms/pretty-checkbox@3.1.0/dist/pretty-checkbox.min.css',
'https://cdn.materialdesignicons.com/5.5.55/css/materialdesignicons.min.css',
],
themeConfig: {
Expand Down Expand Up @@ -56,6 +56,30 @@ module.exports = {
},
},
plugins: [
[
'@docusaurus/plugin-pwa',
{
debug: true,
offlineModeActivationStrategies: ['appInstalled', 'queryString'],
pwaHead: [
{
tagName: 'link',
rel: 'icon',
href: '/img/logo.png',
},
{
tagName: 'link',
rel: 'manifest',
href: '/manifest.json', // your PWA manifest
},
{
tagName: 'meta',
name: 'theme-color',
content: 'rgb(131, 56, 194)',
},
],
},
],
[
'@djthoms/docusaurus-plugin-sass',
{
Expand Down
3 changes: 2 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
"deploy": "docusaurus deploy"
},
"dependencies": {
"@djthoms/pretty-checkbox": "^3.0.3",
"@docusaurus/core": "^2.0.0-alpha.58",
"@docusaurus/plugin-ideal-image": "^2.0.0-alpha.58",
"@docusaurus/plugin-pwa": "^2.0.0-alpha.63",
"@docusaurus/preset-classic": "^2.0.0-alpha.58",
"@docusaurus/theme-live-codeblock": "^2.0.0-alpha.58",
"@docusaurus/theme-search-algolia": "^2.0.0-alpha.58",
"@mdi/js": "^5.5.55",
"clsx": "^1.1.1",
"pretty-checkbox": "^3.0.3",
"pretty-checkbox-react": "^3.0.0-alpha.1",
"react-markdown": "^4.3.1"
},
Expand Down
2 changes: 1 addition & 1 deletion docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
{
'Main Concepts': [
'main-concepts/components',
// 'main-concepts/internationalization',
'main-concepts/internationalization',
'main-concepts/accessibility',
'main-concepts/uncontrolled',
'main-concepts/controlled',
Expand Down
2 changes: 1 addition & 1 deletion docs/src/css/custom.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* stylelint-disable docusaurus/copyright-header */

@import '~pretty-checkbox/src/scss/variables';
@import '~@djthoms/pretty-checkbox/src/scss/variables';

:root {
--ifm-color-primary: #8d38c2;
Expand Down
Binary file added docs/static/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions docs/static/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"short_name": "PCR",
"name": "Pretty Checkbox React",
"description": "Pretty Checkbox React",
"icons": [
{
"src": "/img/logo.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "/images/logo.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"background_color": "#3367D6",
"display": "standalone",
"scope": "/",
"theme_color": "#3367D6"
}
Loading

0 comments on commit c9d3d67

Please sign in to comment.