Skip to content

Commit 0294ed5

Browse files
authored
Remove local-storage hook (#822)
1 parent 5e53343 commit 0294ed5

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

package-lock.json

Lines changed: 0 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"node": "^14.18.0 || >=16.4.0"
77
},
88
"dependencies": {
9-
"@rehooks/local-storage": "^2.3.0",
109
"@rmwc/base": "^7.0.3",
1110
"@rmwc/button": "^7.0.3",
1211
"@rmwc/card": "^7.0.3",

src/components/Home/LocalWarningCallout.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { useLocalStorage, writeStorage } from '@rehooks/local-storage';
1817
import { Button } from '@rmwc/button';
1918
import { GridCell } from '@rmwc/grid';
20-
import React from 'react';
19+
import React, { useState } from 'react';
2120

2221
import { Callout } from '../common/Callout';
2322
import { CONSOLE_ROOT } from '../common/constants';
@@ -29,7 +28,8 @@ export const LocalWarningCallout: React.FC<
2928
projectId: string;
3029
}>
3130
> = ({ projectId }) => {
32-
const [isDismissed] = useLocalStorage<boolean>(DISMISS_KEY);
31+
// TODO: investigate local-storage
32+
const [isDismissed, setIsDismissed] = useState(false);
3333

3434
if (isDismissed) {
3535
return null;
@@ -50,7 +50,7 @@ export const LocalWarningCallout: React.FC<
5050
<Button
5151
label="Dismiss"
5252
onClick={() => {
53-
writeStorage(DISMISS_KEY, true);
53+
setIsDismissed(true);
5454
}}
5555
/>
5656
</>

0 commit comments

Comments
 (0)