質問編集履歴

1

コード追加(App.tsx,Speak.tsx)

2020/05/22 04:44

投稿

nakapon9517
nakapon9517

スコア3

test CHANGED
File without changes
test CHANGED
@@ -365,3 +365,195 @@
365
365
  }
366
366
 
367
367
  ```
368
+
369
+
370
+
371
+ ##以下追記
372
+
373
+ ###App.tsx
374
+
375
+ ```
376
+
377
+ import React from "react";
378
+
379
+ import "./App.css";
380
+
381
+ import Speak from "./containers/Speak";
382
+
383
+
384
+
385
+ const App: React.FC = () => {
386
+
387
+ return (
388
+
389
+ <React.Fragment>
390
+
391
+ <Speak />
392
+
393
+ </React.Fragment>
394
+
395
+ );
396
+
397
+ };
398
+
399
+
400
+
401
+ export default App;
402
+
403
+ ```
404
+
405
+
406
+
407
+
408
+
409
+ ###Speak.tsx
410
+
411
+ ```
412
+
413
+ import React, { FC } from "react";
414
+
415
+ import { Fold } from "speak";
416
+
417
+ // import { makeStyles, Theme, createStyles } from "@material-ui/core/styles";
418
+
419
+ import { withStyles, WithStyles, StyleRules } from "@material-ui/core/styles";
420
+
421
+ import Paper from "@material-ui/core/Paper";
422
+
423
+ import Header from "../components/Header";
424
+
425
+ import SideBar from "../components/SideBar";
426
+
427
+ import Body from "../components/Body";
428
+
429
+ import Footer from "../components/Footer";
430
+
431
+
432
+
433
+ const styles = (): StyleRules => ({
434
+
435
+ flex: {
436
+
437
+ // backgroundColor: theme.palette.background.paper,
438
+
439
+ display: "flex",
440
+
441
+ },
442
+
443
+ sidebar: {
444
+
445
+ width: "30%",
446
+
447
+ border: "0.8px solid gray",
448
+
449
+ margin: "5px",
450
+
451
+ },
452
+
453
+ body: {
454
+
455
+ width: "100%",
456
+
457
+ margin: "5px 5px 5px 0px",
458
+
459
+ border: "0.8px solid gray",
460
+
461
+ },
462
+
463
+ foot: {
464
+
465
+ height: "10px",
466
+
467
+ textAlign: "right",
468
+
469
+ margin: "10px",
470
+
471
+ },
472
+
473
+ });
474
+
475
+
476
+
477
+ type Props = WithStyles<typeof styles> & {
478
+
479
+ folders: Fold[];
480
+
481
+ folderAdd: () => void;
482
+
483
+ folderDel: () => void;
484
+
485
+ fileAdd: () => void;
486
+
487
+ fileDel: () => void;
488
+
489
+ musicStart: () => void;
490
+
491
+ musicStop: () => void;
492
+
493
+ musicEnd: () => void;
494
+
495
+ };
496
+
497
+
498
+
499
+ const Speak: FC<Props> = ({
500
+
501
+ classes,
502
+
503
+ folderAdd,
504
+
505
+ folderDel,
506
+
507
+ fileAdd,
508
+
509
+ fileDel,
510
+
511
+ musicStart,
512
+
513
+ musicStop,
514
+
515
+ musicEnd,
516
+
517
+ folders,
518
+
519
+ }) => {
520
+
521
+ return (
522
+
523
+ <div>
524
+
525
+ <Header />
526
+
527
+ <div className={classes.flex}>
528
+
529
+ <Paper className={classes.sidebar}>
530
+
531
+ <SideBar folders={folders} />
532
+
533
+ </Paper>
534
+
535
+ <Paper className={classes.body}>
536
+
537
+ <Body />
538
+
539
+ </Paper>
540
+
541
+ </div>
542
+
543
+ <div className={classes.foot}>
544
+
545
+ <Footer />
546
+
547
+ </div>
548
+
549
+ </div>
550
+
551
+ );
552
+
553
+ };
554
+
555
+
556
+
557
+ export default withStyles(styles)(Speak);
558
+
559
+ ```