From a8b2cfdb3760c7b311c53fc0c36d7a9a6da87dd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Sat, 26 Jun 2021 12:13:56 +0200 Subject: [PATCH] Move formatJsonString to lib/utils/format.js --- components/teks/teks-drawer.js | 6 ++---- lib/utils/format.js | 3 +++ 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 lib/utils/format.js diff --git a/components/teks/teks-drawer.js b/components/teks/teks-drawer.js index d14c6ac..8480ffa 100644 --- a/components/teks/teks-drawer.js +++ b/components/teks/teks-drawer.js @@ -23,6 +23,8 @@ import MenuIcon from '@material-ui/icons/Menu' import {makeStyles, useTheme} from '@material-ui/core/styles' +import {formatJsonString} from '../../lib/utils/format' + import DrawerBar from './drawer-bar' import DenyeTeks from './denye-teks' import VweKouteAchte from './vwe-koute-achte' @@ -118,10 +120,6 @@ const useStyles = makeStyles(theme => ({ } })) -const formatJsonString = stringToFormat => { - return stringToFormat.split('\n').map((string, index) =>
{`${string}`}
) // eslint-disable-line react/no-array-index-key -} - const langToArray = anTeks => { const langArray = [] diff --git a/lib/utils/format.js b/lib/utils/format.js new file mode 100644 index 0000000..387c8eb --- /dev/null +++ b/lib/utils/format.js @@ -0,0 +1,3 @@ +export const formatJsonString = stringToFormat => { + return stringToFormat.split('\n').map((string, index) =>
{`${string}`}
) // eslint-disable-line react/no-array-index-key +}