Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Green button #13

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
useEffect(() => void insideUseEffect(), [markdown]);
async function insideUseEffect() {
// prepare dictionary
let d = ExtractDefinitions(markdown, opts.prefix, opts.suffix);

Check failure on line 60 in src/App.tsx

View workflow job for this annotation

GitHub Actions / Lint (ESLint)

'd' is never reassigned. Use 'const' instead
const newd = new Map<string, string>();
const promises: Promise<Map<string, string>>[] = [];
d.forEach((v, k) => {
Expand All @@ -69,10 +69,10 @@
Promise.all(promises).then(() => setDict(newd));

// prepare HTML
var md;

Check failure on line 72 in src/App.tsx

View workflow job for this annotation

GitHub Actions / Lint (ESLint)

Unexpected var, use let or const instead
try {
md = replaceExternalSyntax(markdown.replace(/!define[\s\S]*$/m, "")); // !define以下をすべて取り去る。
} catch (e: any) {

Check failure on line 75 in src/App.tsx

View workflow job for this annotation

GitHub Actions / Lint (ESLint)

Unexpected any. Specify a different type
md = e.toString();
}
MDToHTML(md.replaceAll(opts.prefix, "##").replaceAll(opts.suffix, ""))
Expand Down Expand Up @@ -142,27 +142,27 @@
};

return (
<>

Check failure on line 145 in src/App.tsx

View workflow job for this annotation

GitHub Actions / Lint (ESLint)

'React' must be in scope when using JSX
<div className="save_container">

Check failure on line 146 in src/App.tsx

View workflow job for this annotation

GitHub Actions / Lint (ESLint)

'React' must be in scope when using JSX
<div className="upload_save">

Check failure on line 147 in src/App.tsx

View workflow job for this annotation

GitHub Actions / Lint (ESLint)

'React' must be in scope when using JSX
<UploadMarkdown onFileContentChange={setFileContent} />

Check failure on line 148 in src/App.tsx

View workflow job for this annotation

GitHub Actions / Lint (ESLint)

'React' must be in scope when using JSX
<Button variant="text" onClick={saveFile}>
<Button variant="text" onClick={saveFile} color="success">

Check failure on line 149 in src/App.tsx

View workflow job for this annotation

GitHub Actions / Lint (ESLint)

'React' must be in scope when using JSX
保存
</Button>
</div>
<div className="upload_save">

Check failure on line 153 in src/App.tsx

View workflow job for this annotation

GitHub Actions / Lint (ESLint)

'React' must be in scope when using JSX
<UploadImage onImageChange={handleImageChange} />

Check failure on line 154 in src/App.tsx

View workflow job for this annotation

GitHub Actions / Lint (ESLint)

'React' must be in scope when using JSX
</div>
</div>
{visualize == false && (
<>
<div className="upload_save">
<div className="upload_save">
<Button
variant="text"
onClick={() => {
setVisualize(true);
}}
>
color="success">
編集画面の表示
</Button>
</div>
Expand All @@ -180,7 +180,7 @@
onClick={() => {
setVisualize(false);
}}
>
color="success">
編集画面の非表示
</Button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ button {
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #70ffe0;
background-color: #C9F569;
cursor: pointer;
transition: border-color 0.25s;
}
Expand Down
4 changes: 2 additions & 2 deletions src/uploadImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
};

export default function UploadImage({ onImageChange }: ImageUploadProps) {
const [imageFile, setImageFile] = useState<File | null>(null);

Check failure on line 16 in src/uploadImage.tsx

View workflow job for this annotation

GitHub Actions / Build

'imageFile' is declared but its value is never read.
const fileInputRef = useRef<HTMLInputElement>(null);

// 初回ロード時に localStorage から画像データを読み込む
Expand Down Expand Up @@ -60,10 +60,10 @@
/>
</label>

<Button onClick={() => fileInputRef.current?.click()}>
<Button variant="contained" onClick={() => fileInputRef.current?.click()}color="success">
ファイルを選択
</Button>
<Button onClick={deleteStoredImage}>
<Button variant="contained" onClick={deleteStoredImage} color="success">
消去する
</Button>
</>
Expand Down
4 changes: 2 additions & 2 deletions src/uploadMarkdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
};

export default function UploadMarkdown({ onFileContentChange }: MarkdownProps) {
const [textFile, setTextFile] = useState<File | null>(null);

Check failure on line 16 in src/uploadMarkdown.tsx

View workflow job for this annotation

GitHub Actions / Build

'textFile' is declared but its value is never read.
const fileInputRef = useRef<HTMLInputElement>(null);

// 初回ロード時に localStorage からデータを読み込む
useEffect(() => {
const storedText = localStorage.getItem('item');
const fileName = localStorage.getItem('filename');

Check failure on line 22 in src/uploadMarkdown.tsx

View workflow job for this annotation

GitHub Actions / Build

'fileName' is declared but its value is never read.
if (storedText) {
onFileContentChange(storedText); // 親コンポーネントにデータを渡す
}
Expand Down Expand Up @@ -63,10 +63,10 @@
/>
</label>

<Button onClick={() => fileInputRef.current?.click()}>
<Button variant="contained" onClick={() => fileInputRef.current?.click()} color="success">
ファイルを選択
</Button>
<Button onClick={deleteStoredText}>
<Button variant="contained" onClick={deleteStoredText} color="success">
消去する
</Button>
</>
Expand Down
Loading