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

Api #21

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Api #21

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
4 changes: 2 additions & 2 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
}

.App-logo {
height: 40vmin;
height: 3cm;
pointer-events: none;
}

Expand All @@ -19,7 +19,7 @@
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
font-size: xx-large;
color: white;
}

Expand Down
66 changes: 58 additions & 8 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,72 @@
import logo from './logo.svg';
import './App.css';
import logo from "./logo.svg";
import "./App.css";
import { useEffect, useState } from "react";

function App() {
let [count1, setCount] = useState(0);
let [count2, badCount] = useState(0);
const [data, setData] = useState(undefined);
useEffect(() => {
fetch("https://api.gethub.com/ussers/t-riku-hub")
.then((res) => res.json())
.then((json) => setData(json));
}, []);
return (
<div className="App">
<header className="App-header bg-wed">
<img src={logo} className="App-logo" alt="logo" />
<p className="text-wed-dark">
Welcome to <code>WED</code> Community.
<header className="App-header bg-pastel-green">
<img
src="https://png.pngtree.com/png-vector/20240525/ourlarge/pngtree-person-a-logo-with-a-person-in-it-vector-png-image_6930827.png"
className="App-logo"
alt="logo"
/>
<p className="text-pastel-purple underline">
<code>WED</code> Communityへようこそ
</p>
<a
className="text-wed-dark underline"
className="text-pastel-red underline "
href="https://wed.company/"
target="_blank"
rel="noopener noreferrer"
>
Learn WED
WEDについて→
</a>
<a href="/newpage" className="text-pastel-red underline">
コミュニティーページ
</a>
<p
className="text-pastel-red text-2xl bg-pastel-purple p-1 m-2 rounded-lg hover:text-4xl"
onClick={() => {
setCount(count1 + 1);
}}
>
👍{count1}
</p>
<p
className="text-pastel-red text-2xl bg-pastel-purple p-1 m-2 rounded-lg hover:text-4xl"
onClick={() => {
badCount(count2 + 1);
}}
>
👎{count2}
</p>
<p
className="text-pastel-red text-2xl bg-pastel-purple"
onclick={() => {}}
>
ボタンを押した回数:{count1 + count2}
</p>
{data ? (
<>
<img
className="w-32 rounded-full mt-10"
alt="icon"
src={data.avatar_url}
/>
<p className="text-wed-dark">{data.login}</p>
</>
) : (
<p>no data</p>
)}
</header>
</div>
);
Expand Down
11 changes: 11 additions & 0 deletions src/NewPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from "react";

function NewPage() {
return (
<div className="NewPage">
<h1>コミュニティーページ</h1>
<a>10月のイベントについて</a>
</div>
);
}
export default NewPage;
17 changes: 9 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import { BrowserRouter, Route, Routes } from 'react-router-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';

const root = ReactDOM.createRoot(document.getElementById('root'));
import React from "react";
import ReactDOM from "react-dom/client";
import { BrowserRouter, Route, Routes } from "react-router-dom";
import "./index.css";
import App from "./App";
import reportWebVitals from "./reportWebVitals";
import NewPage from "./NewPage";
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
<React.StrictMode>
<BrowserRouter>
<Routes>
<Route path="/" element={<App />} />
<Route path="/newpage" element={<NewPage />} />
</Routes>
</BrowserRouter>
</React.StrictMode>
Expand Down
17 changes: 8 additions & 9 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./src/**/*.{js,jsx}",
],
content: ["./src/**/*.{js,jsx}"],
theme: {
colors: {
wed: '#D2D2C6',
'wed-dark': '#6D695D',
},
extend: {
wed: "#D2D2C6",
"wed-dark": "#6D695D",
"pastel-red": "#ff8484",
"pastel-purple": "#9966ff",
"pastel-green": "#008000",
},
extend: {},
},
plugins: [],
}

};