-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Translation of the Page:
Composition vs Inheritance
(#113)
* composition-vs-inheritance: done used CodeSandox as it's happening upstream: reactjs/react.dev#913 ...which allows uploading CSS (currently we can't with CodePen) * Prettier fix/offsets missed on 1 file * Update content/docs/composition-vs-inheritance.md Co-Authored-By: deblasis <[email protected]>
- Loading branch information
1 parent
2fd0303
commit 45cdfc1
Showing
10 changed files
with
314 additions
and
79 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.BordoFigo { | ||
padding: 10px 10px; | ||
border: 10px solid; | ||
} | ||
|
||
.BordoFigo-blue { | ||
border-color: blue; | ||
} | ||
|
||
.Finestra-titolo { | ||
margin: 0; | ||
font-family: sans-serif; | ||
} | ||
|
||
.Finestra-messaggio { | ||
font-size: larger; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import './1.css'; | ||
|
||
function BordoFigo(props) { | ||
return ( | ||
<div className={'BordoFigo BordoFigo-' + props.colore}> | ||
{props.children} | ||
</div> | ||
); | ||
} | ||
|
||
function FinestraBenvenuto() { | ||
return ( | ||
<BordoFigo colore="blue"> | ||
<h1 className="Finestra-titolo">Benvenuto/a!</h1> | ||
<p className="Finestra-messaggio"> | ||
Ti ringraziamo per questa tua visita nella nostra | ||
nave spaziale! | ||
</p> | ||
</BordoFigo> | ||
); | ||
} | ||
|
||
ReactDOM.render( | ||
<FinestraBenvenuto />, | ||
document.getElementById('root') | ||
); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
html, body, #root { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.Pannello { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.Pannello-sinistra { | ||
float: left; | ||
width: 30%; | ||
height: 100%; | ||
} | ||
|
||
.Pannello-destra { | ||
float: left; | ||
width: 70%; | ||
height: 100%; | ||
} | ||
|
||
.Contatti { | ||
width: 100%; | ||
height: 100%; | ||
background: lightblue; | ||
} | ||
|
||
.Chat { | ||
width: 100%; | ||
height: 100%; | ||
background: pink; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import './2.css'; | ||
|
||
function Contatti() { | ||
return <div className="Contatti" />; | ||
} | ||
|
||
function Chat() { | ||
return <div className="Chat" />; | ||
} | ||
|
||
function Pannello(props) { | ||
return ( | ||
<div className="Pannello"> | ||
<div className="Pannello-sinistra"> | ||
{props.sinistra} | ||
</div> | ||
<div className="Pannello-destra">{props.destra}</div> | ||
</div> | ||
); | ||
} | ||
|
||
function App() { | ||
return ( | ||
<Pannello sinistra={<Contatti />} destra={<Chat />} /> | ||
); | ||
} | ||
|
||
ReactDOM.render(<App />, document.getElementById('root')); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.BordoFigo { | ||
padding: 10px 10px; | ||
border: 10px solid; | ||
} | ||
|
||
.BordoFigo-blue { | ||
border-color: blue; | ||
} | ||
|
||
.Finestra-titolo { | ||
margin: 0; | ||
font-family: sans-serif; | ||
} | ||
|
||
.Finestra-messaggio { | ||
font-size: larger; | ||
} |
Oops, something went wrong.