+ {data.mostRecentColors.map((_, i) => {
+ let index = data.mostRecentColors.length - 1 - i;
+ let recentColor = data.mostRecentColors[index];
+
+ return (
+ props.setActiveColor(recentColor)}
+ style={{
+ background: `rgb(${recentColor.r}, ${recentColor.g}, ${recentColor.b})`
+ }}>
+
+ )
+ })}
+ */}
)
}
diff --git a/src/pages/Home/Frames.tsx b/src/pages/Home/Frames.tsx
index bf03b01..c6ad44e 100644
--- a/src/pages/Home/Frames.tsx
+++ b/src/pages/Home/Frames.tsx
@@ -1,24 +1,22 @@
-import React, { useState, useEffect } from 'react';
-import { ICanvas, ILayer, IFrame, IPreview } from './';
+import { Preview } from './Preview';
import { IoPlay, IoStop, IoCopy } from "react-icons/io5";
+import React, { useState, useEffect, useReducer } from 'react';
+import { ICanvas, ILayer, IFrame, IPreview } from '../../types';
+import { initReducerState, reducer, useCanvas } from '../../utils';
import { BsFillCaretLeftFill, BsFillCaretRightFill } from "react-icons/bs";
import { MdAddPhotoAlternate, MdDelete, MdLayers, MdLayersClear } from "react-icons/md";
-import { Preview } from './Preview';
interface IProps {
frames: IFrame[];
- canvas?: ICanvas;
- preview: IPreview;
activeFrame: IFrame;
activeLayer: ILayer;
- defaultCanvasSize: number;
setFrames: React.Dispatch