Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

implement redordering of skills

Amruth Pillaie2d9b00f7d4f
diff --git a/src/components/LeftSidebar/LeftSidebar.js b/src/components/LeftSidebar/LeftSidebar.js
index d2b29bfec..2c65b5e16 100644
--- a/src/components/LeftSidebar/LeftSidebar.js
+++ b/src/components/LeftSidebar/LeftSidebar.js
@@ -30,7 +30,7 @@ const LeftSidebar = () => {
{ key: 'references', name: data.references.heading },
{ key: 'extras', name: data.extras.heading },
];
- const [currentTab, setCurrentTab] = useState(tabs[0].key);
+ const [currentTab, setCurrentTab] = useState(tabs[6].key);
const onChange = (key, value) => {
dispatch({
type: 'on_input',
diff --git a/src/components/LeftSidebar/tabs/Skills.js b/src/components/LeftSidebar/tabs/Skills.js
index 06d207aa9..98d123d42 100644
--- a/src/components/LeftSidebar/tabs/Skills.js
+++ b/src/components/LeftSidebar/tabs/Skills.js
@@ -3,7 +3,7 @@ import React, { useState, useContext } from 'react';
import AppContext from '../../../context/AppContext';
import Checkbox from '../../../shared/Checkbox';
import TextField from '../../../shared/TextField';
-import { addItem, deleteItem } from '../../../utils';
+import { addItem, deleteItem, moveItemUp, moveItemDown } from '../../../utils';
import ItemHeading from '../../../shared/ItemHeading';
const SkillsTab = ({ data, onChange }) => {
@@ -92,18 +92,38 @@ const Item = ({ item, index, onChange, dispatch }) => {
const identifier = `data.skills.items[${index}]`;
return (
- <div className="my-4 grid grid-cols-6 gap-4">
- <div className="col-span-5">
+ <div className="my-4 grid grid-cols-12">
+ <div className="col-span-9">
<Form item={item} onChange={v => onChange(identifier, v)} />
</div>
+ <button
+ type="button"
+ onClick={() => moveItemUp(dispatch, 'skills', item)}
+ className="col-span-1 text-gray-600 hover:text-red-600 text-sm font-medium"
+ >
+ <div className="flex justify-end items-center">
+ <i className="material-icons font-bold text-lg">arrow_upward</i>
+ </div>
+ </button>
+
+ <button
+ type="button"
+ onClick={() => moveItemDown(dispatch, 'skills', item)}
+ className="col-span-1 text-gray-600 hover:text-red-600 text-sm font-medium"
+ >
+ <div className="flex justify-end items-center">
+ <i className="material-icons font-bold text-lg">arrow_downward</i>
+ </div>
+ </button>
+
<button
type="button"
onClick={() => deleteItem(dispatch, 'skills', item)}
className="col-span-1 text-gray-600 hover:text-red-600 text-sm font-medium"
>
<div className="flex justify-end items-center">
- <i className="material-icons font-bold text-lg pr-4">close</i>
+ <i className="material-icons font-bold text-lg">close</i>
</div>
</button>
</div>