Skip to content

Commit

Permalink
[FIX] feature flag condition and typescript conversion (#2745) (#2746)
Browse files Browse the repository at this point in the history
* convert to TS and correct condition

* commo folder sync
  • Loading branch information
Jsyro authored Oct 26, 2023
1 parent 2e494d8 commit e762721
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import * as actionTypes from "../constants/actionTypes";
import { VERIFIABLE_CREDENTIALS } from "../constants/reducerTypes";
import { RootState } from "@/App";
import { IVCInvitation, LOADING_STATUS } from "@mds/common";

/**
* @file verifiableCredentialReducer.js
* all data associated with verificable credential records.
*/

interface verifiableCredentialState {
vcWalletConnectionInvitation: IVCInvitation;
}

const initialState = {
vcWalletConnectionInvitation: {},
vcWalletConnectionInvitation: {} as IVCInvitation,
};

const verifiableCredentialReducer = (state = initialState, action) => {
Expand All @@ -26,7 +32,7 @@ const verifiableCredentialReducerObject = {
[VERIFIABLE_CREDENTIALS]: verifiableCredentialReducer,
};

export const getVCWalletConnectionInvitation = (state) =>
export const getVCWalletConnectionInvitation = (state: RootState) =>
state[VERIFIABLE_CREDENTIALS].vcWalletConnectionInvitation;

export default verifiableCredentialReducerObject;
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import * as actionTypes from "../constants/actionTypes";
import { VERIFIABLE_CREDENTIALS } from "../constants/reducerTypes";
import { RootState } from "@/App";
import { IVCInvitation, LOADING_STATUS } from "@mds/common";

/**
* @file verifiableCredentialReducer.js
* all data associated with verificable credential records.
*/

interface verifiableCredentialState {
vcWalletConnectionInvitation: IVCInvitation;
}

const initialState = {
vcWalletConnectionInvitation: {},
vcWalletConnectionInvitation: {} as IVCInvitation,
};

const verifiableCredentialReducer = (state = initialState, action) => {
Expand All @@ -26,7 +32,7 @@ const verifiableCredentialReducerObject = {
[VERIFIABLE_CREDENTIALS]: verifiableCredentialReducer,
};

export const getVCWalletConnectionInvitation = (state) =>
export const getVCWalletConnectionInvitation = (state: RootState) =>
state[VERIFIABLE_CREDENTIALS].vcWalletConnectionInvitation;

export default verifiableCredentialReducerObject;
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ export const PermitsTable = (props) => {
dataIndex: "permitee_guid",
render: (text, record) => {
if (isFeatureEnabled(Feature.VERIFIABLE_CREDENTIALS)) {
return <div></div>;
} else {
return (
<div title="">
{record.majorMineInd && record.status === "Open" && (
Expand All @@ -77,6 +75,8 @@ export const PermitsTable = (props) => {
)}
</div>
);
} else {
return <div></div>;
}
},
},
Expand Down

0 comments on commit e762721

Please sign in to comment.