Created
January 24, 2022 02:08
-
-
Save n8rzz/85de718bb7560d85116745c7ebe0b210 to your computer and use it in GitHub Desktop.
app-index-and-css.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* src/App.tsx | |
*/ | |
import "./styles.css"; | |
import React from "react"; | |
import { Card } from "./Card"; | |
interface IProps {} | |
export const App: React.FC<IProps> = (props) => { | |
return ( | |
<div className="app"> | |
<ul className="hlist"> | |
<li> | |
<Card /> | |
</li> | |
<li> | |
<Card /> | |
</li> | |
</ul> | |
</div> | |
); | |
}; | |
/** | |
* index.tsx | |
*/ | |
import { render } from "react-dom"; | |
import { App } from "./App"; | |
const rootElement = document.getElementById("root"); | |
render(<App />, rootElement); | |
/** | |
* styles.css | |
*/ | |
.app { | |
font-family: sans-serif; | |
padding: 20px 0; | |
text-align: center; | |
} | |
.card { | |
border: 1px solid green; | |
} | |
.hlist { | |
display: flex; | |
justify-content: center; | |
list-style-type: none; | |
margin: 0; | |
padding: 0; | |
} | |
.hlist > * + * { | |
margin-left: 2rem; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment