Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
250 commits
Select commit Hold shift + click to select a range
9f61e44
hook parsing function works for webpack transformed, direct, and name…
garrettlchow Dec 1, 2024
c29ac21
added function based reducer counter in demo app
garrettlchow Dec 2, 2024
e95923c
class state and funcitonal states rendering correctly on hover
garrettlchow Dec 2, 2024
45107cf
added reducer state logic to time jump so state on the same page can …
garrettlchow Dec 2, 2024
9f2b5af
fixed correct reducer and state differentiation
garrettlchow Dec 2, 2024
c80d006
corrected bug where snapshots did not render after idle time. Impleme…
elliesimens Dec 3, 2024
f54e534
improved comments for the bug fixes and cleaned up the old, refactore…
elliesimens Dec 3, 2024
96d749f
both useState and useReducer states rendering on tool tip display but…
garrettlchow Dec 3, 2024
030d2d2
Merge pull request #1 from oslabs-beta/elliefeature
elliesimens Dec 3, 2024
8df2a7c
moved reducer display under state in tool tip display
garrettlchow Dec 3, 2024
ff0e102
Merge branch 'dev' into feature/garrett
garrettlchow Dec 3, 2024
160b062
Merge pull request #2 from oslabs-beta/feature/garrett
garrettlchow Dec 3, 2024
36c6ef3
added more reducer info in reducer state
garrettlchow Dec 3, 2024
a141020
updated how reducers are rendered on the component map
garrettlchow Dec 3, 2024
9cc9d7f
verified multiple reducers render on front end component map
garrettlchow Dec 3, 2024
6f28fb4
added code to force re-render of useReducer states but app does not r…
garrettlchow Dec 4, 2024
67da2d5
added new dropdown menu
ragad-mohammed Dec 4, 2024
769cfcc
Co-authored-by: dryczek01 <dryczek01@users.noreply.github.com>
ragad-mohammed Dec 4, 2024
5641074
added overrideReducer function to intercept useReducer hooks
garrettlchow Dec 4, 2024
8f70979
Merge pull request #3 from oslabs-beta/feature/ragad
elliesimens Dec 4, 2024
2603f35
working on the interception functionality in order to expand time jum…
elliesimens Dec 4, 2024
22e1fbc
researching drop down functionality
ragad-mohammed Dec 4, 2024
f6dab23
Merge branch 'dev' into feature/ragad
ragad-mohammed Dec 4, 2024
5701e79
added useContext to demo app
garrettlchow Dec 5, 2024
784f646
added SET STATE action in reducers
garrettlchow Dec 5, 2024
606b08c
Semi-Done swapper
dryczek01 Dec 5, 2024
9531171
added show/noShow div
ragad-mohammed Dec 5, 2024
5a25feb
parsed tree to exclude context providers and consumers
garrettlchow Dec 6, 2024
4f2a453
filtered context hooks from tree
garrettlchow Dec 6, 2024
b9fc68e
added functioning individual vertical sliders per route
pinardo88 Dec 6, 2024
5a89b32
Original Changes before dev pull
dryczek01 Dec 6, 2024
80d9880
Connected my code with dev
dryczek01 Dec 6, 2024
759e5e0
Merge pull request #4 from oslabs-beta/daniel
dryczek01 Dec 6, 2024
f7f1754
Merge branch 'dev' into feature/garrett
garrettlchow Dec 6, 2024
a65ab5d
rendering nested structure complete
ragad-mohammed Dec 6, 2024
da3451c
Merge branch 'dev' into click-tab/ragad
ragad-mohammed Dec 6, 2024
4d5b562
passed props to ProvConTainer
ragad-mohammed Dec 7, 2024
fd2b5f2
prepare for dev merge
garrettlchow Dec 7, 2024
20a5052
Merge pull request #6 from oslabs-beta/feature/garrett
garrettlchow Dec 7, 2024
e0c98b3
props passed to component
ragad-mohammed Dec 7, 2024
febc66b
pulled from dev
ragad-mohammed Dec 7, 2024
8c71160
fix slider not updating when jumping to a snapshot
pinardo88 Dec 7, 2024
b1b2ebb
fixed ts error on MainSlider
pinardo88 Dec 7, 2024
9ad19c6
removed MainSlider
pinardo88 Dec 7, 2024
bcd1cba
merged with current dev, working state
pinardo88 Dec 7, 2024
7bb8211
Merge pull request #7 from oslabs-beta/PatriceFeature
pinardo88 Dec 7, 2024
c55b13f
moved slider into each route component
pinardo88 Dec 9, 2024
0f0b00e
removed unnecessary flexbox and div
pinardo88 Dec 9, 2024
98498ab
Merge pull request #8 from oslabs-beta/PatriceFeature
pinardo88 Dec 9, 2024
d2864e6
styled the clear button
garrettlchow Dec 9, 2024
db39cb3
Merge branch 'dev' into feature/ellie
elliesimens Dec 9, 2024
10950e8
garrettlchow Dec 9, 2024
3566580
fix reflow/ repaint issue on snapshots
pinardo88 Dec 9, 2024
2b0aec0
Merge pull request #9 from oslabs-beta/PatriceFeature
pinardo88 Dec 9, 2024
1efadc0
removed cartesian versus polar view due to polar view being nonfuncti…
elliesimens Dec 9, 2024
dfa5eb6
Merge branch 'dev' into feature/ellie
elliesimens Dec 9, 2024
cd86f25
styled clear button and route description header
garrettlchow Dec 9, 2024
8864b70
Merge branch 'dev' into feature/garrett
garrettlchow Dec 9, 2024
4c1c412
adjusted for fixed siwth of action container
garrettlchow Dec 9, 2024
d5183ba
Merge pull request #10 from oslabs-beta/feature/ellie
elliesimens Dec 9, 2024
e79c3c1
fixed snapshot naming and current status of snapshots
garrettlchow Dec 9, 2024
717f87d
styled the actions in snapshots, working on slider
garrettlchow Dec 10, 2024
46549c8
styled slider thumb
garrettlchow Dec 10, 2024
eaeb8a7
finished styling for slider and jump/current buttons
garrettlchow Dec 10, 2024
d955152
started styling collapse
garrettlchow Dec 10, 2024
5d933c4
Merge branch 'dev' into feature/garrett
garrettlchow Dec 10, 2024
f6eaf44
removed override reducer code and updated version number to 26
garrettlchow Dec 10, 2024
72fa443
Merge pull request #11 from oslabs-beta/feature/garrett
garrettlchow Dec 10, 2024
9c4491b
removed current tab
garrettlchow Dec 10, 2024
145eb4e
styled collapse arrow
garrettlchow Dec 10, 2024
a1a08bb
styled record text and added red circle
garrettlchow Dec 10, 2024
7e472a2
styled record toggle
garrettlchow Dec 10, 2024
8a1631e
aligned collapse arrow
garrettlchow Dec 10, 2024
aa1a2b1
switched record toggle off ot gray
garrettlchow Dec 10, 2024
97fd9f1
Provider/Consumer display complete
ragad-mohammed Dec 10, 2024
161bd5f
Merge branch 'dev' into click-tab/ragad
ragad-mohammed Dec 10, 2024
bc71bea
moved travel container and buttons container next to each other on th…
garrettlchow Dec 10, 2024
d08c871
styled buttons in buttons container
garrettlchow Dec 10, 2024
5cd0ef9
updated using lucide-react icons
garrettlchow Dec 10, 2024
63573cb
styled reconnect green dot
garrettlchow Dec 10, 2024
972bc58
removed heat-map-legend container
garrettlchow Dec 10, 2024
ba6c07c
Merge pull request #5 from oslabs-beta/click-tab/ragad
ragad-mohammed Dec 10, 2024
eec0cb1
working on styling react-select
garrettlchow Dec 10, 2024
5ee3365
Merge branch 'dev' into feature/garrett
garrettlchow Dec 10, 2024
5bc2dc1
Merge pull request #12 from oslabs-beta/feature/garrett
garrettlchow Dec 10, 2024
6ee75ad
styling prov/con container
ragad-mohammed Dec 10, 2024
b2770d3
Merge branch 'dev' into click-tab/ragad
ragad-mohammed Dec 10, 2024
61c3e41
made buttons in buttons container flex to container size for larger s…
garrettlchow Dec 10, 2024
29b9284
began styling navbar
garrettlchow Dec 10, 2024
af04286
cleaned up some unused styling
garrettlchow Dec 11, 2024
e7c9536
fixed collapse function with fixed action container width
garrettlchow Dec 11, 2024
2c41358
changed the default component map view from diagonal to step view, an…
elliesimens Dec 11, 2024
3e4453a
Merge pull request #13 from oslabs-beta/feature/ellie
elliesimens Dec 11, 2024
983f275
updated reconnection logic to further correct loss of port connection…
elliesimens Dec 11, 2024
a8e59dd
removed state and diff buttons
garrettlchow Dec 11, 2024
b9d2639
Merge pull request #14 from oslabs-beta/feature/ellie
elliesimens Dec 11, 2024
f21fb35
further corrected reconnection logic
elliesimens Dec 11, 2024
dfa8329
finished styling navbar
garrettlchow Dec 11, 2024
1f9d2c1
Merge branch 'dev' into feature/garrett
garrettlchow Dec 11, 2024
6efed94
Merge pull request #15 from oslabs-beta/feature/garrett
garrettlchow Dec 11, 2024
2797416
removed duplicate main-navbar-container
garrettlchow Dec 11, 2024
1ad0514
adjusted padding for current snapshot
garrettlchow Dec 11, 2024
2795c6d
cleaned up alot of code
garrettlchow Dec 11, 2024
29203cd
removed head contrainer
garrettlchow Dec 11, 2024
958140a
Merge pull request #16 from oslabs-beta/feature/garrett
garrettlchow Dec 11, 2024
9bb43dc
fixed tutorial for map tab
garrettlchow Dec 11, 2024
61cbc29
prov/con container complete
ragad-mohammed Dec 12, 2024
38c2157
Merge branch 'dev' into click-tab/ragad
ragad-mohammed Dec 12, 2024
0d2decc
Merge pull request #17 from oslabs-beta/click-tab/ragad
garrettlchow Dec 12, 2024
66acd36
Merge branch 'dev' into feature/garrett
garrettlchow Dec 12, 2024
5fc0a63
switched component map for presentation
garrettlchow Dec 12, 2024
c3bb351
styled link controls
garrettlchow Dec 12, 2024
4382f7c
added responsive styling for container size for link controls
garrettlchow Dec 12, 2024
b442626
deleted extra slider styling
garrettlchow Dec 12, 2024
a1110a0
removed rendering frequency styling sheet
garrettlchow Dec 12, 2024
d957939
removed old override files
garrettlchow Dec 12, 2024
9b7a65e
styled tree a little more
garrettlchow Dec 12, 2024
a1c7488
styled component map to white nodes and light gray background
garrettlchow Dec 13, 2024
6703afa
updated color sceheme for links and root
garrettlchow Dec 13, 2024
218b5d8
fixed collapse for root node
garrettlchow Dec 13, 2024
49a64df
Merge branch 'dev' into feature/ellie
elliesimens Dec 13, 2024
e6125c2
Merge pull request #18 from oslabs-beta/feature/ellie
elliesimens Dec 13, 2024
825cdef
adjusted color scheme for node links
garrettlchow Dec 13, 2024
6824840
resolved merge conflicts
garrettlchow Dec 13, 2024
04ddaab
fixed aspect ratio for initial loading of app
garrettlchow Dec 13, 2024
7f628b3
began styling tool tip display
garrettlchow Dec 13, 2024
788104d
changed null color to red
garrettlchow Dec 13, 2024
22f9055
moved all information into one tool tip display
garrettlchow Dec 14, 2024
deb1d8a
fixed padding for tool tip display
garrettlchow Dec 14, 2024
1e187c8
added function to only show tool tip display when there there are pro…
garrettlchow Dec 14, 2024
e4419ec
finished styling tool tip display
garrettlchow Dec 14, 2024
95ed895
swapped to a white color scheme
garrettlchow Dec 14, 2024
d5f3d1e
Merge pull request #19 from oslabs-beta/feature/garrett
garrettlchow Dec 14, 2024
1914fea
added nesting for deeply nested properties
garrettlchow Dec 14, 2024
af9851b
filtered link select for context hooks
garrettlchow Dec 14, 2024
52648bb
began styling performance controls
garrettlchow Dec 14, 2024
3eb2fdf
adjsuted width of tool tip display
garrettlchow Dec 14, 2024
d156496
cleaned up styling code
garrettlchow Dec 14, 2024
e96421e
finished styling performance tab
garrettlchow Dec 14, 2024
75affe7
truncated long node names with ellipses
garrettlchow Dec 14, 2024
a9689de
added alarms permissions in manifest chrome
garrettlchow Dec 14, 2024
12f942e
began styling the web metrics need to fix hover effect
garrettlchow Dec 15, 2024
7ca9ec9
added auto scroll for snapshots
garrettlchow Dec 15, 2024
f86eb5c
began styling history nodes
garrettlchow Dec 16, 2024
1c882fc
styled d3 tree in history need to style tool tip hover
garrettlchow Dec 16, 2024
d7c817b
remove tool tip hover for first snapshot in history link
garrettlchow Dec 16, 2024
67d00d9
Merge pull request #20 from oslabs-beta/feature/garrett
garrettlchow Dec 16, 2024
f8eaed7
styled history nodes into rects
garrettlchow Dec 16, 2024
a01d644
moved text fromtool tip hover into history nodes
garrettlchow Dec 16, 2024
fb681ba
added null checks for checkDiff in history tree
garrettlchow Dec 16, 2024
882823f
removed scrolling for map and perforamnce and added scrolling for tre…
garrettlchow Dec 16, 2024
d96d5a9
history nodes styled, working on state properties that are objects
garrettlchow Dec 16, 2024
5cda6fe
added scroll bar for history nodes
garrettlchow Dec 17, 2024
1c276e3
ax tree functional
ragad-mohammed Dec 17, 2024
a593a57
Merge branch 'dev' into axMap-update
ragad-mohammed Dec 17, 2024
0efea9b
Merge pull request #21 from oslabs-beta/axMap-update
ragad-mohammed Dec 17, 2024
22fd64f
Merge branch 'dev' into feature/garrett
garrettlchow Dec 17, 2024
1b2140b
finished styling history tab
garrettlchow Dec 17, 2024
435a0a1
styled ax buttons need to move other buttons
garrettlchow Dec 17, 2024
034a11b
began styling ax controls
garrettlchow Dec 17, 2024
d5883b8
removed ax legend button
garrettlchow Dec 17, 2024
bac5f56
added reducer state data to tool tip display
garrettlchow Dec 19, 2024
78703ac
removed axlegend files and reducer
garrettlchow Dec 19, 2024
0019d3f
made ax tree nodes less round
garrettlchow Dec 19, 2024
36d64a6
Merge pull request #22 from oslabs-beta/feature/garrett
garrettlchow Dec 19, 2024
0fcdfb6
finished styling provider consumer panel and added hover tool tip dis…
garrettlchow Dec 19, 2024
951682c
added max height for tool tip display
garrettlchow Dec 19, 2024
1f25046
adjsuted aspect ratio for component map
garrettlchow Dec 19, 2024
13c25e3
started ax tree tool tip display hover
garrettlchow Dec 20, 2024
2117bcd
finished styling ax tool tip display
garrettlchow Dec 20, 2024
b632e23
finished style ax tab
garrettlchow Dec 20, 2024
60abeaa
began styling reconnect dialog popup
garrettlchow Dec 20, 2024
c9c9c44
Merge pull request #23 from oslabs-beta/feature/garrett
garrettlchow Dec 20, 2024
0dcb068
cleaned up some files
garrettlchow Dec 20, 2024
c6f3f75
added disable ax button
garrettlchow Dec 20, 2024
f2d5dd8
fixed web metrics tool tip display
garrettlchow Dec 20, 2024
1f185e5
Co-authored-by: pinardo88 <pinardo88@users.noreply.github.com>
dryczek01 Dec 21, 2024
bf67b20
added ellie's fix for sending snapshots to reactime after re-opening
garrettlchow Dec 21, 2024
b6a537f
Merge pull request #25 from oslabs-beta/feature/garrett
garrettlchow Dec 21, 2024
d508696
fixed pause/ play logic
pinardo88 Dec 21, 2024
42e5672
sync slider movement with play/ pause
pinardo88 Dec 21, 2024
1ea5912
Merge pull request #26 from oslabs-beta/PatriceFeature
pinardo88 Dec 21, 2024
08c39d5
Tutorial needs updated dev code
dryczek01 Dec 21, 2024
b813c22
began styling travel buttons
garrettlchow Dec 21, 2024
9e48e06
removed unused errorHandler file
garrettlchow Dec 21, 2024
121b2c1
began style error container
garrettlchow Dec 21, 2024
a70ffc6
Merge branch 'dev' into daniel
dryczek01 Dec 21, 2024
1433558
Only accessibility tab needs to be fixed
dryczek01 Dec 21, 2024
3e8edcf
Merge pull request #27 from oslabs-beta/daniel
dryczek01 Dec 21, 2024
7bde26b
Merge branch 'dev' into feature/garrett
garrettlchow Dec 21, 2024
49b69e8
began styling play button
garrettlchow Dec 21, 2024
998f53e
finally finished styling current shapshot button
garrettlchow Dec 21, 2024
5ea7847
removed reconnect dialog and replaced with hot toast notification
garrettlchow Dec 21, 2024
7cdcad5
removed old reverse and fast forward code
garrettlchow Dec 21, 2024
74cc04d
beagn styling tutorial
garrettlchow Dec 22, 2024
e778fc0
fixed sass warning messages using deprecated code
garrettlchow Dec 22, 2024
a091920
updated sass and sass loader in package.json to fix warnings
garrettlchow Dec 22, 2024
d14f327
Merge pull request #28 from oslabs-beta/feature/garrett
garrettlchow Dec 22, 2024
1b4709d
removed button controls from action container
garrettlchow Dec 22, 2024
a1b4119
removed collapse function
garrettlchow Dec 22, 2024
ca8ed40
added dark mode icon
garrettlchow Dec 22, 2024
2d4e18b
styled dark mode slider
garrettlchow Dec 23, 2024
05d796c
added varibles for colors
garrettlchow Dec 23, 2024
4f8b852
continued styling dark mode
garrettlchow Dec 23, 2024
f454891
added dark styles for link controls
garrettlchow Dec 23, 2024
e6a4f07
added dark mode for ax tree
garrettlchow Dec 23, 2024
7f85f74
changed string trext color to be visible in dark mode
garrettlchow Dec 23, 2024
c851c05
finished adding dark mode to everything except bar graph and react dr…
garrettlchow Dec 23, 2024
9ff8fc8
styled both drop downs
garrettlchow Dec 23, 2024
1fa5e0b
finished styling bar graph
garrettlchow Dec 23, 2024
f201e3d
Merge pull request #29 from oslabs-beta/feature/garrett
garrettlchow Dec 23, 2024
7c6a416
styled current location button
garrettlchow Dec 23, 2024
4b1e2ce
added transparent background to tool tip displays
garrettlchow Dec 23, 2024
6eb4162
styled web metrics and moved history to second position
garrettlchow Dec 23, 2024
77970fe
added transprent background to ax tree tool tip display
garrettlchow Dec 23, 2024
94ee09c
styled enable button
garrettlchow Dec 23, 2024
68c64ee
added styling to the sun in light mode in theme toggle
garrettlchow Dec 23, 2024
5bedb62
added styling for jump button hover
garrettlchow Dec 23, 2024
e804515
added auto scroll for history link
garrettlchow Dec 23, 2024
7b8b70c
adjusted component map size and added port disconenct listerner logic…
garrettlchow Dec 23, 2024
52d1b97
adjusted positioning of bar graph and ax tree
garrettlchow Dec 23, 2024
4da2415
added invalid payload checks
garrettlchow Dec 23, 2024
6addc91
added hook state for providers in provCon container
garrettlchow Dec 23, 2024
f73612e
fixed web metrics hover error
garrettlchow Dec 24, 2024
18b0574
fixed invalid color in web metrics
garrettlchow Dec 24, 2024
eb33407
Merge pull request #30 from oslabs-beta/feature/garrett
garrettlchow Dec 24, 2024
b68608a
updated acitons test
garrettlchow Dec 24, 2024
5e3e6b2
removed irrelevant frontend test files
garrettlchow Dec 24, 2024
268032d
added more actions buttons tests working on theme toggle tests
garrettlchow Dec 27, 2024
0907893
finished adding unit tests for actions buttons, could not pass theme …
garrettlchow Dec 27, 2024
55564f9
passed all vertical slider tests
garrettlchow Dec 27, 2024
e6680df
passed all time travel tests
garrettlchow Dec 27, 2024
9fccebf
buttons container tests all passing
garrettlchow Dec 27, 2024
ccf3fd5
updated testing for main container
garrettlchow Dec 27, 2024
db0d9a4
updated travel container tests
garrettlchow Dec 27, 2024
6fe1268
updated tutorial testing
garrettlchow Dec 27, 2024
10255dc
added tests for performance
garrettlchow Dec 27, 2024
a77bd53
completed performance tests
garrettlchow Dec 27, 2024
41eb204
completed web metrics tests
garrettlchow Dec 27, 2024
c5e9f74
added state container tests
garrettlchow Dec 27, 2024
a902d6e
minor updates to backend testing
garrettlchow Dec 27, 2024
435f1c1
Merge pull request #31 from oslabs-beta/feature/garrett
garrettlchow Dec 27, 2024
e42051b
completed state container tests
garrettlchow Dec 28, 2024
f731403
updated styling for demo tic tac toe app
garrettlchow Dec 29, 2024
ea92b93
Merge pull request #32 from oslabs-beta/feature/garrett
garrettlchow Dec 30, 2024
1d5454b
reverted disconnection changes to background and content script
garrettlchow Dec 31, 2024
4bccc0f
Merge pull request #33 from oslabs-beta/feature/garrett
garrettlchow Dec 31, 2024
038a15b
reverted error container
garrettlchow Dec 31, 2024
2a78823
removed all urls matches for content scripts in chrome manifest
garrettlchow Dec 31, 2024
3fd54d8
added some styling to old error container
garrettlchow Dec 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

4 changes: 0 additions & 4 deletions Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 reactime
Copyright (c) 2025 reactime

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
You can view your application's file structure and click on a snapshot to view
your app's state. State can be visualized in a Component Graph, JSON Tree, or
Performance Graph. Snapshot history can be visualized in the History tab.
The Web Metrics tab provides some useful metrics for site performance. The accessibility tab
The Web Metrics tab provides some useful metrics for site performance. The accessibility tab
visualizes an app's accessibility tree per state change.
Snapshots can be compared with the previous snapshot, which can be viewed in Diff mode.
<br>
Expand Down Expand Up @@ -89,7 +89,7 @@ Download the recorded snapshots as a JSON file and upload them to access state t
</p>
<br>

### 🔹 Reconnect and Status
### 🔹 and Status

If Reactime loses its connection to the tab you're monitoring, simply click the "reconnect" button to resume your work. You'll notice a circle located to the right of the button, which will appear as either red (indicating disconnection) or green (signifying a successful reconnection).
<br>
Expand Down
2 changes: 1 addition & 1 deletion demo-app-next/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
19 changes: 15 additions & 4 deletions demo-app-next/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
Expand All @@ -12,8 +16,15 @@
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve"
"jsx": "preserve",
"target": "ES2017"
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules"
]
}
2 changes: 2 additions & 0 deletions demo-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"devDependencies": {
"@babel/core": "^7.16.7",
"@babel/plugin-transform-runtime": "^7.25.9",
"@babel/preset-env": "^7.16.7",
"@babel/preset-react": "^7.16.7",
"@types/express": "^4.17.13",
Expand All @@ -17,6 +18,7 @@
"@types/react-dom": "^17.0.19",
"babel-loader": "^8.2.3",
"copy-webpack-plugin": "^10.2.0",
"core-js": "^3.39.0",
"css-loader": "^6.5.1",
"html-webpack-plugin": "^5.5.0",
"node": "^16.0.0",
Expand Down
86 changes: 73 additions & 13 deletions demo-app/src/client/Components/Buttons.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,82 @@
import React from 'react';
import Increment from './Increment';
import React, { Component, useState } from 'react';

function Buttons(): JSX.Element {
const buttons = [];
for (let i = 0; i < 4; i++) {
buttons.push(<Increment key={i} />);
type ButtonProps = {
id: string;
label: string;
color?: string;
initialCount?: number;
};

type IncrementClassState = {
count: number;
};

class IncrementClass extends Component<ButtonProps, IncrementClassState> {
state = {
count: this.props.initialCount || 0,
};

handleClick = (): void => {
this.setState((prevState: IncrementClassState) => ({
count: prevState.count + 1,
}));
};

render(): JSX.Element {
return (
<div>
<button
id={this.props.id}
className='increment'
onClick={this.handleClick}
style={{ backgroundColor: this.props.color }}
>
{this.props.label} {this.state.count} times.
</button>
</div>
);
}
}

const IncrementFunction = (props: ButtonProps): JSX.Element => {
const [count, setCount] = useState(props.initialCount || 0);

const handleClick = (): void => {
setCount((prev) => prev + 1);
};

return (
<div className='buttons'>
<h1>Stateful Buttons</h1>
<h4>
These buttons are functional components that each manage their own state with the useState
hook.
</h4>
{buttons}
<div>
<button
id={props.id}
className='increment'
onClick={handleClick}
style={{ backgroundColor: props.color }}
>
{props.label} {count} times.
</button>
</div>
);
};

class Buttons extends Component {
render(): JSX.Element {
return (
<div className='buttons'>
<h1>Mixed State Counter</h1>
<h4>First two buttons use class components, last two use function components.</h4>
<IncrementClass id='class1' label='Class Button 1:' color='#f00008' initialCount={5} />
<IncrementClass id='class2' label='Class Button 2:' color='#62d6fb' />
<IncrementFunction
id='func1'
label='Function Button 1:'
color='#6288fb'
initialCount={10}
/>
<IncrementFunction id='func2' label='Function Button 2:' color='#ff6569' />
</div>
);
}
}

export default Buttons;
61 changes: 0 additions & 61 deletions demo-app/src/client/Components/ButtonsWithMoreHooks.jsx

This file was deleted.

Loading