Fakultas Ilmu Komputer UI
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Hackernews Clone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Muhammad Zaki
Hackernews Clone
Commits
af1ae57c
Commit
af1ae57c
authored
2 years ago
by
Muhammad Zaki
Browse files
Options
Downloads
Patches
Plain Diff
feat: added routes
parent
0f88ee59
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/src/App.res
+17
-42
17 additions, 42 deletions
client/src/App.res
with
17 additions
and
42 deletions
client/src/App.res
+
17
−
42
View file @
af1ae57c
@module
(
"./logo.svg"
)
external
logo
:
string
=
"default"
module
Routes
=
{
%%
raw
(
`import './App.css'`
)
@react.component
@react.component
let
make
=
()
=>
{
let
make
=
()
=>
{
let
(
count
,
setCount
)
=
React
.
useState
(()
=>
0
)
let
url
=
RescriptReactRouter
.
useUrl
(
)
<
div
className
=
"App"
>
switch
url
.
path
{
<
header
className
=
"App-header"
>
|
list
{
"users"
,
_id
}
=>
<
UserPage
/>
<
img
src
=
{
logo
}
className
=
"App-logo"
alt
=
"logo"
/>
|
list
{
"stories"
,
_id
}
=>
<
StoryPage
/>
<
p
>
{
"Hello Vite + React + ReScript!"
->
React
.
string
}
</
p
>
|
list
{}
=>
<
StoriesPage
/>
<
p
>
|
_
=>
<
div
>
{
"Not found. Sorry."
->
React
.
string
}
</
div
>
<
button
onClick
=
{
_e
=>
setCount
(
count
=>
count
+
1
)}
>
}
{
`count is:
${
count
->
Belt
.
Int
.
toString
}
`
->
React
.
string
}
}
</
button
>
}
</
p
>
<
p
>
@react.component
{
"Edit "
->
React
.
string
}
let
make
=
()
=>
{
<
code
>
{
"App.res"
->
React
.
string
}
</
code
>
<>
{
" and save to test HMR updates."
->
React
.
string
}
<
Nav
/>
</
p
>
<
Routes
/>
<
p
>
</>
<
a
className
=
"App-link"
href
=
"https://reactjs.org"
target
=
"_blank"
rel
=
"noopener noreferrer"
>
{
"Learn React"
->
React
.
string
}
</
a
>
{
" | "
->
React
.
string
}
<
a
className
=
"App-link"
href
=
"https://vitejs.dev/guide/features.html"
target
=
"_blank"
rel
=
"noopener noreferrer"
>
{
"Vite Docs"
->
React
.
string
}
</
a
>
{
" | "
->
React
.
string
}
<
a
className
=
"App-link"
href
=
"https://rescript-lang.org/docs/react/latest/introduction"
target
=
"_blank"
rel
=
"noopener noreferrer"
>
{
"ReScript Docs"
->
React
.
string
}
</
a
>
</
p
>
</
header
>
</
div
>
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment