Skip to content

Commit c6f3f75

Browse files
committed
added disable ax button
1 parent 0dcb068 commit c6f3f75

File tree

11 files changed

+66
-11
lines changed

11 files changed

+66
-11
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 reactime
3+
Copyright (c) 2025 reactime
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

src/app/FrontendTypes.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,8 @@ export interface AxContainer {
399399
};
400400
snapshots: [];
401401
currLocation: object;
402+
setShowTree: any;
403+
setShowParagraph: any;
402404
}
403405

404406
export interface FilteredNode {

src/app/components/StateRoute/AxMap/Ax.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export type LinkTypesProps = {
3232
};
3333

3434
export default function AxTree(props) {
35-
const { currLocation, axSnapshots, width, height } = props;
35+
const { currLocation, axSnapshots, width, height, setShowTree, setShowParagraph } = props;
3636

3737
let margin = defaultMargin;
3838
let totalWidth = width;
@@ -157,6 +157,8 @@ export default function AxTree(props) {
157157
setOrientation={setOrientation}
158158
setLinkType={setLinkType}
159159
setStepPercent={setStepPercent}
160+
setShowTree={setShowTree}
161+
setShowParagraph={setShowParagraph}
160162
/>
161163
</div>
162164

src/app/components/StateRoute/AxMap/AxContainer.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const AxContainer = (props: AxContainer) => {
1111
snapshot, // from 'tabs[currentTab]' object in 'MainContainer'
1212
snapshots, // from 'tabs[currentTab].snapshotDisplay' object in 'MainContainer'
1313
currLocation, // from 'tabs[currentTab]' object in 'MainContainer'
14+
setShowTree,
15+
setShowParagraph,
1416
} = props;
1517

1618
return (
@@ -28,6 +30,8 @@ const AxContainer = (props: AxContainer) => {
2830
currLocation={currLocation}
2931
width={width}
3032
height={h}
33+
setShowTree={setShowTree}
34+
setShowParagraph={setShowParagraph}
3135
/>
3236
);
3337
}}

src/app/components/StateRoute/AxMap/axLinkControls.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import React from 'react';
2+
import { useDispatch } from 'react-redux';
3+
import { toggleAxTree, setCurrentTabInApp } from '../../../slices/mainSlice';
24

35
const AxLinkControls = ({
46
orientation,
@@ -7,9 +9,30 @@ const AxLinkControls = ({
79
setOrientation,
810
setLinkType,
911
setStepPercent,
12+
setShowTree,
13+
setShowParagraph,
1014
}) => {
15+
const dispatch = useDispatch();
16+
const disableAxTree = () => {
17+
dispatch(toggleAxTree('toggleAxRecord'));
18+
dispatch(setCurrentTabInApp('AxTree'));
19+
setShowTree(false);
20+
setShowParagraph(true);
21+
};
22+
1123
return (
1224
<div className='link-controls'>
25+
<div className='accessibility-disable'>
26+
<input
27+
type='radio'
28+
id='disable'
29+
name='accessibility'
30+
value='disable'
31+
onChange={disableAxTree}
32+
/>
33+
<label htmlFor='disable'>Disable</label>
34+
</div>
35+
1336
<div className='control-group'>
1437
<label className='control-label'>Orientation:</label>
1538
<select

src/app/components/StateRoute/AxMap/useForceUpdate.tsx

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/app/components/StateRoute/History.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ function History(props: Record<string, unknown>): JSX.Element {
114114
if (!delta) return 'No state changes';
115115

116116
const changedState = findStateChangeObj(delta);
117-
console.log('changed state', formatters.html.format(changedState[0]));
118117
return changedState.length > 0 ? formatters.html.format(changedState[0]) : 'No state changes';
119118
} catch (error) {
120119
console.error('Error in findDiff:', error);

src/app/components/StateRoute/StateRoute.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ const StateRoute = (props: StateRouteProps) => {
119119
snapshot={snapshot}
120120
snapshots={snapshots}
121121
currLocation={currLocation}
122+
setShowTree={setShowTree}
123+
setShowParagraph={setShowParagraph}
122124
/>
123125
</div>
124126
) : (

src/app/styles/components/_ax.scss

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,40 @@
3434
transition: all 200ms ease;
3535
user-select: none;
3636
}
37+
3738
.accessibility-controls label:hover {
3839
background-color: #0d9488;
3940
transform: translateY(-1px);
4041
}
4142

43+
.accessibility-disable input[type='radio'] {
44+
display: none;
45+
}
46+
47+
.accessibility-disable label {
48+
display: inline-flex;
49+
align-items: center;
50+
justify-content: center;
51+
min-width: 60px;
52+
padding: 6px 12px;
53+
font-family: 'Outfit', sans-serif;
54+
font-size: 14px;
55+
font-weight: 500;
56+
background-color: #f9fafb;
57+
border: 1px solid #e5e7eb;
58+
color: #374151;
59+
border-radius: 6px;
60+
cursor: pointer;
61+
transition: all 200ms ease;
62+
user-select: none;
63+
}
64+
65+
.accessibility-disable label:hover {
66+
border-color: #d1d5db;
67+
background-color: #f3f4f6;
68+
transform: translateY(-1px);
69+
}
70+
4271
.accessibility-text {
4372
padding: 12px 24px;
4473
max-width: 800px;

src/app/styles/main.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ body {
2121
// 1. Configuration and helpers
2222
@import 'abstracts/variablesLM';
2323

24-
// 3. Base stuff
24+
// 3. Base
2525
@import 'base/helpers';
2626

2727
// 4. Layout-related sections

0 commit comments

Comments
 (0)