Skip to content

Commit f9c7936

Browse files
author
Rachel Kucharski
committed
AppStateSlice TS Converted no errors
1 parent 1aa2988 commit f9c7936

File tree

4 files changed

+23
-9
lines changed

4 files changed

+23
-9
lines changed

app/src/helperFunctions/manageSeparators.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const separator = {
1414
const manageSeparators: ManageSeparators = {
1515
nextTopSeparatorId: 1000,
1616
// this function checks for two separators in a row or missing separators and adds/removes as needed
17-
handleSeparators: (arr: ChildElement[], str?) => {
17+
handleSeparators: (arr, str) => {
1818
if (
1919
(str === 'delete' || str === 'change position') &&
2020
arr.length === 1 &&
@@ -73,7 +73,7 @@ const manageSeparators: ManageSeparators = {
7373
},
7474

7575
// this function replaces separators onto which an element is dropped with the element itself
76-
mergeSeparator: (arr: ChildElement[], index: number) => {
76+
mergeSeparator: (arr, index) => {
7777
return arr.map((child) => {
7878
// Added additional nested types for lists
7979
if (

app/src/interfaces/Interfaces.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ export interface ChildElement {
2323
name: string;
2424
childId: number;
2525
style: object;
26-
attributes: object;
26+
attributes: Attributes;
2727
events: object;
2828
children?: ChildElement[];
2929
stateProps: StateProp[]; // state: [ { id, key, value, type }, ...]
30-
stateUsed?: object;
30+
stateUsed?: StateUsed;
3131
passedInProps: StateProp[];
3232
}
3333

@@ -46,7 +46,7 @@ export interface Component {
4646
useStateCodes: string[];
4747
useContext?: object;
4848
passedInProps: StateProp[];
49-
stateUsed?: object;
49+
stateUsed?: StateUsed;
5050
}
5151
export interface StateProp {
5252
id: string;
@@ -107,7 +107,21 @@ export interface AddRoutes {
107107
}
108108

109109
export interface ManageSeparators {
110-
mergeSeparator: (arg1:any, arg2:any) => any; // update specificity
111-
handleSeparators: (arg1: any, arg2?: any) => any; // update specificity
110+
mergeSeparator: (arg1:ChildElement[], arg2?:number) => any; // update specificity
111+
handleSeparators: (arg1: ChildElement[], arg2?: string) => number;
112112
nextTopSeparatorId: number
113113
}
114+
115+
export interface StateUsed {
116+
compTextProviderId: number;
117+
compTextPropsId: number;
118+
compText: string;
119+
compLinkProviderId: number;
120+
compLinkPropsId: number;
121+
compLink: string;
122+
}
123+
124+
export interface Attributes {
125+
compText?: string;
126+
compLink?: string;
127+
}

app/src/redux/reducers/slice/appStateSlice.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ export const {
13081308
deletePassedInProps,
13091309
deleteState,
13101310
toggleLoggedIn,
1311-
configToggle,
1311+
//configToggle,
13121312
snapShotAction,
13131313
allCooperativeState
13141314
} = appStateSlice.actions;

app/src/redux/reducers/slice/contextReducer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit';
77
interface Context {
88
name: string;
99
values: Array<{ key: string; value: string }>;
10-
components: Array<string>;
10+
components: string[];
1111
}
1212

1313
interface AddContextPayload {

0 commit comments

Comments
 (0)