Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8d0e0b2

Browse files
committed
more updates
1 parent77e29c5 commit8d0e0b2

File tree

8 files changed

+95
-66
lines changed

8 files changed

+95
-66
lines changed

‎start/client/apollo.config.js‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
1+
module.exports={
2+
client:{
3+
name:"Full Stack Tutorial",
4+
// url: "https://apollo-fullstack-tutorial.herokuapp.com/graphql",
5+
service:"Full-Stack-Tutorial-ztag5s",
6+
},
7+
};

‎start/client/package-lock.json‎

Lines changed: 0 additions & 11 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎start/client/package.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"polished":"^4.2.2",
1515
"react":"^18.2.0",
1616
"react-dom":"^18.2.0",
17-
"react-emotion":"^10.0.0",
1817
"react-router":"^6.4.1",
1918
"react-router-dom":"^6.4.1",
2019
"react-scripts":"^5.0.1",

‎start/client/src/components/launch-tile.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
importReactfrom'react';
21
importstyledfrom'@emotion/styled';
32
import{css}from'@emotion/css'
43
import{Link}from'react-router-dom';
@@ -13,7 +12,7 @@ export function getBackgroundImage(id: string) {
1312
return`url(${backgrounds[Number(id)%backgrounds.length]})`;
1413
}
1514

16-
exportdefault({ launch}:any)=>{
15+
consttile=({ launch}:any)=>{
1716
const{ id, mission, rocket}=launch;
1817
return(
1918
<StyledLink
@@ -28,6 +27,8 @@ export default ({ launch }: any) => {
2827
);
2928
};
3029

30+
exportdefaulttile
31+
3132
/**
3233
* STYLED COMPONENTS USED IN THIS FILE ARE BELOW HERE
3334
*/

‎start/client/src/index.tsx‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import{ApolloClient,ApolloProvider}from'@apollo/client';
2+
import{cache}from'./cache';
3+
importReactfrom'react';
4+
importReactDOMfrom'react-dom/client';
5+
importPagesfrom'./pages';
6+
importinjectStylesfrom'./styles';
7+
8+
// Initialize ApolloClient
9+
constclient=newApolloClient({
10+
cache,
11+
uri:'http://localhost:4000/graphql',
12+
});
13+
14+
injectStyles();
15+
16+
// Pass the ApolloClient instance to the ApolloProvider component
17+
18+
constroot=ReactDOM.createRoot(document.getElementById("root")!);
19+
root.render(
20+
<ApolloProviderclient={client}>
21+
<Pages/>
22+
</ApolloProvider>,
23+
);
24+
25+
26+
// ReactDOM.render(
27+
// <ApolloProvider client={client}>
28+
// <Pages />
29+
// </ApolloProvider>,
30+
// document.getElementById('root'),
31+
// );

‎start/client/src/pages/index.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
importReact,{Fragment}from'react';
2-
import{BrowserRouter,Routes,Route}from'react-router-dom'
2+
import{BrowserRouterasRouter,Routes,Route}from'react-router-dom'
33

44
importLaunchfrom'./launch';
55
importLaunchesfrom'./launches';
@@ -9,18 +9,18 @@ import { Footer, PageContainer } from '../components';
99

1010
exportdefaultfunctionPages(){
1111
return(
12+
<Router>
1213
<Fragment>
1314
<PageContainer>
14-
<BrowserRouter>
1515
<Routes>
1616
<Routepath="/"element={<Launches/>}/>
1717
<Routepath="launch/:launchId"element={<Launch/>}/>
1818
<Routepath="cart"element={<Cart/>}/>
1919
<Routepath="profile"element={<Profile/>}/>
2020
</Routes>
21-
</BrowserRouter>
2221
</PageContainer>
2322
<Footer/>
2423
</Fragment>
24+
</Router>
2525
);
2626
}

‎start/client/src/pages/launches.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
importReact,{Fragment,useState}from'react';
1+
importReact,{}from'react';
22
import{BrowserRouterProps}from'react-router-dom';
33
import{gql}from'@apollo/client'
44

‎start/client/src/styles.js‎

Lines changed: 50 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,55 @@
1-
import{injectGlobal}from'react-emotion';
1+
import{injectGlobal}from"@emotion/css";
22

33
exportconstunit=8;
44
exportconstcolors={
5-
primary:'#220a82',
6-
secondary:'#14cbc4',
7-
accent:'#e535ab',
8-
background:'#f7f8fa',
9-
grey:'#d8d9e0',
10-
text:'#343c5a',
11-
textSecondary:'#747790'
5+
primary:"#220a82",
6+
secondary:"#14cbc4",
7+
accent:"#e535ab",
8+
background:"#f7f8fa",
9+
grey:"#d8d9e0",
10+
text:"#343c5a",
11+
textSecondary:"#747790",
1212
};
1313

14-
exportdefault()=>injectGlobal({
15-
[['html','body']]:{
16-
height:'100%',
17-
},
18-
body:{
19-
margin:0,
20-
padding:0,
21-
fontFamily:"'Source Sans Pro', sans-serif",
22-
backgroundColor:colors.background,
23-
color:colors.text,
24-
},
25-
'#root':{
26-
display:'flex',
27-
flexDirection:'column',
28-
minHeight:'100%',
29-
},
30-
'*':{
31-
boxSizing:'border-box',
32-
},
33-
[['h1','h2','h3','h4','h5','h6']]:{
34-
margin:0,
35-
fontWeight:600,
36-
},
37-
h1:{
38-
fontSize:48,
39-
lineHeight:1,
40-
},
41-
h2:{
42-
fontSize:40,
43-
},
44-
h3:{
45-
fontSize:36,
46-
},
47-
h5:{
48-
fontSize:16,
49-
textTransform:'uppercase',
50-
letterSpacing:4,
51-
}
52-
});
14+
conststyles=()=>
15+
injectGlobal({
16+
[["html","body"]]:{
17+
height:"100%",
18+
},
19+
body:{
20+
margin:0,
21+
padding:0,
22+
fontFamily:"'Source Sans Pro', sans-serif",
23+
backgroundColor:colors.background,
24+
color:colors.text,
25+
},
26+
"#root":{
27+
display:"flex",
28+
flexDirection:"column",
29+
minHeight:"100%",
30+
},
31+
"*":{
32+
boxSizing:"border-box",
33+
},
34+
[["h1","h2","h3","h4","h5","h6"]]:{
35+
margin:0,
36+
fontWeight:600,
37+
},
38+
h1:{
39+
fontSize:48,
40+
lineHeight:1,
41+
},
42+
h2:{
43+
fontSize:40,
44+
},
45+
h3:{
46+
fontSize:36,
47+
},
48+
h5:{
49+
fontSize:16,
50+
textTransform:"uppercase",
51+
letterSpacing:4,
52+
},
53+
});
54+
55+
exportdefaultstyles;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp