From b2c7900017bab1c5eab84430abede622f45a380f Mon Sep 17 00:00:00 2001 From: Phuoc Nguyen Date: Tue, 10 Dec 2019 21:16:12 +0700 Subject: [PATCH] Add resizable element pattern --- client/constants/Pattern.ts | 1 + client/pages/ExplorePage.tsx | 1 + client/pages/HomePage.tsx | 2 +- client/patterns/resizable-element/Cover.tsx | 128 ++++++++ client/patterns/resizable-element/Details.tsx | 303 ++++++++++++++++++ public/sitemap.xml | 1 + 6 files changed, 435 insertions(+), 1 deletion(-) create mode 100644 client/patterns/resizable-element/Cover.tsx create mode 100644 client/patterns/resizable-element/Details.tsx diff --git a/client/constants/Pattern.ts b/client/constants/Pattern.ts index a8972de..9e8b96f 100644 --- a/client/constants/Pattern.ts +++ b/client/constants/Pattern.ts @@ -42,6 +42,7 @@ enum Pattern { RadioButtonGroup = 'Radio button group', RadioSwitch = 'Radio switch', Rating = 'Rating', + ResizableElement = 'Resizable element', Ribbon = 'Ribbon', SameHeightColumns = 'Same height columns', SearchBox = 'Search box', diff --git a/client/pages/ExplorePage.tsx b/client/pages/ExplorePage.tsx index c8267a3..5d4dc49 100644 --- a/client/pages/ExplorePage.tsx +++ b/client/pages/ExplorePage.tsx @@ -164,6 +164,7 @@ const ExplorePage = () => { + diff --git a/client/pages/HomePage.tsx b/client/pages/HomePage.tsx index 66cf8e0..93ccd3b 100644 --- a/client/pages/HomePage.tsx +++ b/client/pages/HomePage.tsx @@ -170,7 +170,7 @@ const HomePage = () => { marginBottom: '16px', }} > - 60+ patterns + 62 patterns = () => { + return ( + +
+
+
+
+
+
+
+
+
+
+
+
+ + ); +}; + +export default Cover; diff --git a/client/patterns/resizable-element/Details.tsx b/client/patterns/resizable-element/Details.tsx new file mode 100644 index 0000000..413c91f --- /dev/null +++ b/client/patterns/resizable-element/Details.tsx @@ -0,0 +1,303 @@ +import React from 'react'; + +import DetailsLayout from '../../layouts/DetailsLayout'; +import BrowserFrame from '../../placeholders/BrowserFrame'; + +const Details: React.FC<{}> = () => { + return ( + +
+
+ You can move the mouse over each squares located at the corners and the middle of sides to see + the cursors which indicate the associated side can be resized. +
+ +
+
+
+
+
+
+
+
+
+
+
+ )} + source={` +
+ + ... + + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+
+`} + /> +
+ + ); +}; + +export default Details; diff --git a/public/sitemap.xml b/public/sitemap.xml index 42c87b3..67453dd 100644 --- a/public/sitemap.xml +++ b/public/sitemap.xml @@ -47,6 +47,7 @@ https://csslayout.io/patterns/radio-button-group https://csslayout.io/patterns/radio-switch https://csslayout.io/patterns/rating + https://csslayout.io/patterns/resizable-element https://csslayout.io/patterns/ribbon https://csslayout.io/patterns/same-height-columns https://csslayout.io/patterns/search-box