Skip to content

Commit

Permalink
URL Revert
Browse files Browse the repository at this point in the history
  • Loading branch information
lelouchB committed Mar 8, 2024
1 parent 0f1a122 commit 11a4012
Showing 1 changed file with 28 additions and 31 deletions.
59 changes: 28 additions & 31 deletions frontend/docs/examples/react.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ description: A live example of the Final Space API using React.

You can play around with this live example and add new features, styles and so much more.

:::tip Hint
:::tip Hint
Uncomment the following line:
```jsx
<div className="card--text">{character.species}</div>
```

```jsx
<div className="card--text">{character.species}</div>
```

PS: remove `{/* */}`
PS: remove `{/* */}`
:::

import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';


<Tabs
defaultValue="react"
Expand All @@ -42,27 +42,27 @@ import TabItem from "@theme/TabItem"

```jsx live {18-22,26,27,29,31}
function App() {
const [data, setData] = useState([])
const [data, setData] = useState([]);

const cardStyle = {
boxShadow: "0 5px 8px 0 rgba(0, 0, 0, 0.3)",
padding: "12px",
marginBottom: "10px",
textAlign: "center",
backgroundColor: "#fafafa",
}
};
const rootStyle = {
margin: "0 auto",
width: "max-content",
padding: "0 10px",
color: "purple",
fontFamily: "Verdana",
}
color:"purple",
fontFamily:"Verdana"
};
useEffect(() => {
fetch("http://localhost:3000/api/v0/character?limit=5")
fetch("https://finalspaceapi.com/api/v0/character?limit=5")
.then((res) => res.json())
.then((data) => setData(data))
}, [])
.then((data) => setData(data));
}, []);

return (
<div className="root" style={rootStyle}>
Expand All @@ -72,44 +72,41 @@ function App() {
<img src={character.img_url} alt={character.name} />{" "}
</div>
<div className="card--title">{character.name}</div>
{/* <div className="card--text">{character.species}</div>*/}
{/* <div className="card--text">{character.species}</div>*/}
</div>
))}
</div>
)
);
}
```

</TabItem>
<TabItem value="axios">

```jsx {19-23,27,28,30,32}
{
/* Not a Live Editor*/
}
import axios from "axios"
{/* Not a Live Editor*/}
import axios from 'axios'

function App() {
const [data, setData] = useState([])
const [data, setData] = useState([]);

const cardStyle = {
boxShadow: "0 5px 8px 0 rgba(0, 0, 0, 0.3)",
padding: "12px",
marginBottom: "10px",
textAlign: "center",
backgroundColor: "#fafafa",
}
};
const rootStyle = {
margin: "0 auto",
width: "max-content",
padding: "0 10px",
}
};
useEffect(() => {
axios
.get("https://finalspaceapi.com/api/v0/character?limit=5")
axios.get("https://finalspaceapi.com/api/v0/character?limit=5")
.then((res) => res.json())
.then((data) => setData(data))
}, [])
.then((data) => setData(data));
}, []);

return (
<div className="root" style={rootStyle}>
Expand All @@ -119,11 +116,11 @@ function App() {
<img src={character.img_url} alt={character.name} />{" "}
</div>
<div className="card--title">{character.name}</div>
{/* <div className="card--text">{character.species}</div>*/}
{/* <div className="card--text">{character.species}</div>*/}
</div>
))}
</div>
)
);
}
```

Expand Down

0 comments on commit 11a4012

Please sign in to comment.