Skip to content

Commit

Permalink
Merge pull request #1 from wh1tecat-nya/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
wh1tecat-nya authored Feb 27, 2020
2 parents e5af86f + 96fcb37 commit 65839f4
Show file tree
Hide file tree
Showing 92 changed files with 16,671 additions and 4,344 deletions.
14 changes: 10 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,32 @@ module.exports = {
"eslint:recommended",
"standard",
"plugin:react/recommended",
"plugin:import/typescript",
"plugin:import/recommended",
"plugin:prettier/recommended",
"prettier/standard",
],
plugins: ["react", "@typescript-eslint"],
plugins: ["react", "@typescript-eslint", "import"],
"ecmaFeatures": {
"jsx": true,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
env: {
"jest": true
"browser": true,
},
rules: {
"no-console": "off",
"no-unused-vars": "warn",
"no-irregular-whitespace": "off",
"react/display-name": "off",
"react/jsx-boolean-value": "error",
"react/no-redundant-should-component-update": "error",
"react/no-typos": "error",
"react/no-unused-state": "error",
"react/no-unused-state": "warn",
"react/no-unused-prop-types": "error",
"react/no-deprecated": "error",
"react/no-direct-mutation-state": "error",
Expand All @@ -35,13 +41,13 @@ module.exports = {
"import/named": "off",
"import/no-duplicates": "error",
// https://github.com/bradzacher/eslint-plugin-typescript/issues/2
"no-unused-vars": "off",
},
settings: {
"import/resolver": {
node: {
extensions: [".js", ".ts", ".tsx"],
},
},
"import/core-modules": ["react"]
},
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dist
.npm
.yarn-integrity
.eslintcache
.cache/

# userfiles
.DS_Store
Expand Down
4 changes: 3 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"useTabs": true
"useTabs": true,
"printWidth": 100

}
3 changes: 3 additions & 0 deletions .storybook/addons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import '@storybook/addon-actions/register';
import '@storybook/addon-links/register';
import '@storybook/addon-knobs/register';
12 changes: 12 additions & 0 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {
configure,
} from "@storybook/react";
import "antd/dist/antd.less";

const req = require.context("../src/components", true, /stories.js$/);

function loadStories () {
req.keys().forEach(filename => req(filename));
}

configure(loadStories, module);
7 changes: 7 additions & 0 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const base = require("../webpack.config");
const webpack = require("webpack");

module.exports = {
...base,
plugins: [new webpack.EnvironmentPlugin(["NODE_ENV", "SERVER_URL"])],
};
1 change: 1 addition & 0 deletions .yarnclean
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@types/react-native
4 changes: 4 additions & 0 deletions modules/ISCPD-App/.expo-shared/assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"f9155ac790fd02fadcdeca367b02581c04a353aa6d5aa84409a59f6804c87acd": true,
"89ed26367cdb9b771858e026f2eb95bfdb90e5ae943e716575327ec325f39c44": true
}
11 changes: 11 additions & 0 deletions modules/ISCPD-App/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_modules/**/*
.expo/*
npm-debug.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/
web-report/
1 change: 1 addition & 0 deletions modules/ISCPD-App/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
10 changes: 10 additions & 0 deletions modules/ISCPD-App/AppEntry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { registerRootComponent } from "expo";
import { activateKeepAwake } from "expo-keep-awake";

import App from "./src/App";

if (__DEV__) {
activateKeepAwake();
}

registerRootComponent(App);
30 changes: 30 additions & 0 deletions modules/ISCPD-App/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"expo": {
"name": "ISCPD",
"slug": "ISCPD",
"privacy": "public",
"sdkVersion": "35.0.0",
"platforms": [
"ios",
"android",
"web"
],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
}
}
}
Binary file added modules/ISCPD-App/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added modules/ISCPD-App/assets/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions modules/ISCPD-App/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = function(api) {
api.cache(true);
return {
presets: ["babel-preset-expo"],
};
};
29 changes: 29 additions & 0 deletions modules/ISCPD-App/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "ISCPD-App",
"version": "0.0.1",
"description": "for mobile",
"author": "wh1tecat <[email protected]>",
"main": "./AppEntry.js",
"license": "MIT",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"ISCPD-Contents": "^0.0.1",
"expo": "^35.0.0",
"react": "16.8.3",
"react-dom": "16.8.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz",
"react-native-web": "^0.11.7"
},
"devDependencies": {
"@babel/runtime": "^7.7.2",
"@types/react": "^16.8.23",
"@types/react-native": "^0.57.65",
"babel-preset-expo": "^7.0.0"
}
}
29 changes: 29 additions & 0 deletions modules/ISCPD-App/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from "react";
import { View, Text, WebView } from "react-native";

import { wrapper } from "./utils/wrappter";
// import { OfficialAbsence } from "ISCPD-Contents";
// import convertComponentToHtml from "./utils/covertComponetToHtml";

// type Props = {
// html: string;
// };

export default function App() {
const htmlString = wrapper();
console.log(htmlString);

return (
<>
{/* <View>
<Text>hoge</Text>
</View> */}
{/* <WebView
originWhitelist={["*"]}
source={{ uri: "https://github.com/facebook/react-native" }}
style={{ marginTop: 20 }}
/> */}
<WebView style={{ marginTop: 30, marginLeft: 30 }} source={{ html: htmlString }} />
</>
);
}
26 changes: 26 additions & 0 deletions modules/ISCPD-App/src/utils/covertComponetToHtml.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// import * as React from "react";
import { ReactElement } from "react";
import { renderToString } from "react-dom/server";

export default function convertComponentToHtml(jsx: ReactElement): string {
const body = renderToString(jsx);
return `
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>paper css test</title>
</head>
<body class="A4">
<section className="sheet padding-25mm">
${body}
</section>
</body>
</html>
`.trim();
}
16 changes: 16 additions & 0 deletions modules/ISCPD-App/src/utils/wrappter.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from "react";
import convertComponentToHtml from "./covertComponetToHtml";

import { OfficialAbsence } from "ISCPD-Contents";

export function wrapper() {
console.log(OfficialAbsence);
const jsx = (
<>
<h2>hoge</h2>
{/* <OfficialAbsence /> */}
</>
);
const html = convertComponentToHtml(jsx);
return html;
}
9 changes: 9 additions & 0 deletions modules/ISCPD-App/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.json",
"include": ["./src/*"],
"compilerOptions": {
"jsx": "react-native",
"incremental": true,
"types": ["react", "react-native"]
}
}
Loading

0 comments on commit 65839f4

Please sign in to comment.