Skip to content

Commit

Permalink
svg rect
Browse files Browse the repository at this point in the history
  • Loading branch information
holtzy committed Aug 7, 2024
1 parent 1e79735 commit 682054a
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import TitleAndDescription from '@/component/TitleAndDescription';
import { LayoutCourse } from '@/component/LayoutCourse';
import { lessonList } from '@/util/lessonList';

const previousURL = '/course/introduction/initial-setup';
const currentURL = '/course/introduction/what-is-svg';
const nextURL = '/course/introduction/what-is-svg';
const previousURL = '/course/svg/introduction';
const currentURL = '/course/svg/main-svg-elements';
const nextURL = undefined;
const seoDescription = '';

export default function Home() {
Expand All @@ -30,13 +30,18 @@ export default function Home() {
description={
<>
<p>
Let's create a confortable working environment: let's use Next.js.
In the previous lesson we learnt what SVG is and how to draw a
circle with it.
</p>
<p>
We'll need other shapes to make graphs: rectangle, text, segment.
Let's see how to make them too.
</p>
</>
}
/>

<h2>Why Next.js?</h2>
<h2>Rectangle</h2>
<p>Explain why react is great?</p>
<p>Talk about the setup I recommend: next.js + Typescript</p>
<p>Talk about style management in next.</p>
Expand Down
11 changes: 6 additions & 5 deletions util/lessonList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,22 @@ export const lessonList: Lesson[] = [
),
readTime: 4,
link: '/course/svg/introduction',
status: 'not available',
status: 'wip',
moduleId: 'svg',
},
{
name: 'Your first circle',
name: 'Main SVG elements',
description: (
<>
<p>
Let's make the first drawing of this course! Just a little circle.
Let's learn how to draw the basic SVG shapes: circle, rectangles,
segment and text.
</p>
</>
),
readTime: 4,
link: '/course/svg/first-circle',
status: 'not available',
link: '/course/svg/main-svg-elements',
status: 'wip',
moduleId: 'svg',
},
{
Expand Down
7 changes: 7 additions & 0 deletions viz/SvgRectangle/SvgRectangle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const SvgRectangle = () => {
return (
<svg width={500} height={300}>
<rect x="50" y="50" width="200" height="100" stroke="black" fill="red" />
</svg>
);
};
6 changes: 6 additions & 0 deletions viz/SvgRectangle/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// File used to render something in codesandbox only
import ReactDOM from 'react-dom';
import { SvgRectangle } from './SvgRectangle';

const rootElement = document.getElementById('root');
ReactDOM.render(<SvgRectangle />, rootElement);
28 changes: 28 additions & 0 deletions viz/SvgRectangle/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "pie-chart-basic",
"version": "1.0.0",
"description": "",
"keywords": [],
"main": "index.js",
"dependencies": {
"react": "17.0.2",
"react-dom": "17.0.2",
"react-scripts": "4.0.0"
},
"devDependencies": {
"@babel/runtime": "7.13.8",
"typescript": "4.1.3"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}

0 comments on commit 682054a

Please sign in to comment.