diff --git a/src/assets/dummy/data.json b/src/assets/demo/data.json similarity index 99% rename from src/assets/dummy/data.json rename to src/assets/demo/data.json index 836a5c59..eae6abb8 100644 --- a/src/assets/dummy/data.json +++ b/src/assets/demo/data.json @@ -268,4 +268,4 @@ "accent": "#f44336" } } -} \ No newline at end of file +} diff --git a/src/components/App/App.js b/src/components/App/App.js index ce0a7d37..d06035f5 100644 --- a/src/components/App/App.js +++ b/src/components/App/App.js @@ -32,8 +32,8 @@ const App = () => {
-
-
+
+
{templates.find(x => theme.layout.toLowerCase() === x.key).component()}
diff --git a/src/components/RightSidebar/tabs/Actions.js b/src/components/RightSidebar/tabs/Actions.js index 361c91f4..865e560c 100644 --- a/src/components/RightSidebar/tabs/Actions.js +++ b/src/components/RightSidebar/tabs/Actions.js @@ -28,13 +28,15 @@ const ActionsTab = ({ data, theme, dispatch }) => { pageElement.current.style.maxHeight = 'fit-content'; pageElement.current.style.overflow = 'visible'; html2canvas(pageElement.current, { + scale: 6, useCORS: true, allowTaint: true, }).then(canvas => { pageElement.current.style.maxHeight = '29.7cm'; pageElement.current.style.overflow = 'scroll'; + const image = canvas.toDataURL('image/jpeg', 1.0); - const doc = new jsPDF('p', 'px', 'a4'); + const doc = new jsPDF('p', 'mm', 'a4'); const pageWidth = doc.internal.pageSize.getWidth(); const pageHeight = doc.internal.pageSize.getHeight(); @@ -48,8 +50,8 @@ const ActionsTab = ({ data, theme, dispatch }) => { const marginX = (pageWidth - canvasWidth) / 2; const marginY = (pageHeight - canvasHeight) / 2; - doc.addImage(image, 'JPEG', marginX, marginY, canvasWidth, canvasHeight); - doc.output('dataurlnewwindow'); + doc.addImage(image, 'JPEG', marginX, marginY, canvasWidth, canvasHeight, null, 'SLOW'); + doc.save(`RxResume_${Date.now()}.pdf`); }); }; @@ -62,8 +64,8 @@ const ActionsTab = ({ data, theme, dispatch }) => { dlAnchor.click(); }; - const loadDummyData = () => { - dispatch({ type: 'load_dummy_data' }); + const loadDemoData = () => { + dispatch({ type: 'load_demo_data' }); dispatch({ type: 'save_data' }); }; @@ -118,39 +120,52 @@ const ActionsTab = ({ data, theme, dispatch }) => {
- You can simply press
Cmd/Ctrl + P
at any time - while you're in the app to print your resume, but here's a fancy button to do - the same thing, just 'cause. + You can click on the button below to generate a PDF instantly. Alternatively, you can + also use
Cmd/Ctrl + P
but it would have + different effects.
- +
+ + + +

-
{t('actions.loadDummyData.heading')}
+
{t('actions.loadDemoData.heading')}
-
{t('actions.loadDummyData.body')}
+
{t('actions.loadDemoData.body')}
diff --git a/src/context/AppContext.js b/src/context/AppContext.js index 13cf5a67..cbc38985 100644 --- a/src/context/AppContext.js +++ b/src/context/AppContext.js @@ -3,7 +3,7 @@ import get from 'lodash/get'; import set from 'lodash/set'; import remove from 'lodash/remove'; -import dummyData from '../assets/dummy/data.json'; +import demoData from '../assets/demo/data.json'; import { move } from '../utils'; const initialState = { @@ -125,15 +125,15 @@ const reducer = (state, { type, payload }) => { ...state, ...payload, }; - case 'load_dummy_data': + case 'load_demo_data': return { ...state, - ...dummyData, + ...demoData, }; case 'reset': return initialState; default: - throw state; + return state; } }; diff --git a/src/i18n/index.js b/src/i18n/index.js index cfc55eec..10fe7cee 100644 --- a/src/i18n/index.js +++ b/src/i18n/index.js @@ -1,7 +1,7 @@ import i18n from 'i18next'; import { initReactI18next } from 'react-i18next'; -import resources from './locales'; +import resources from './source'; const languages = [ { diff --git a/src/i18n/source/app/index.js b/src/i18n/source/app/index.js new file mode 100644 index 00000000..d24fe6d1 --- /dev/null +++ b/src/i18n/source/app/index.js @@ -0,0 +1,3 @@ +import app from './app.json'; + +export default app; diff --git a/src/i18n/source/index.js b/src/i18n/source/index.js new file mode 100644 index 00000000..943ca673 --- /dev/null +++ b/src/i18n/source/index.js @@ -0,0 +1,9 @@ +import app from './app'; +import leftSidebar from './leftSidebar'; +import rightSidebar from './rightSidebar'; + +export default { + app, + leftSidebar, + rightSidebar, +}; diff --git a/src/i18n/source/leftSidebar/certifications.json b/src/i18n/source/leftSidebar/certifications.json index 2763082a..92f9dc16 100644 --- a/src/i18n/source/leftSidebar/certifications.json +++ b/src/i18n/source/leftSidebar/certifications.json @@ -8,6 +8,6 @@ "placeholder": "Udacity" }, "description": { - "placeholder": "You can write about what you learnt from your certification program." + "placeholder": "You can write about what you learned from your certification program." } } diff --git a/src/i18n/source/leftSidebar/index.js b/src/i18n/source/leftSidebar/index.js new file mode 100644 index 00000000..a13d6a3e --- /dev/null +++ b/src/i18n/source/leftSidebar/index.js @@ -0,0 +1,23 @@ +import profile from './profile.json'; +import objective from './objective.json'; +import work from './work.json'; +import education from './education.json'; +import awards from './awards.json'; +import certifications from './certifications.json'; +import skills from './skills.json'; +import languages from './languages.json'; +import references from './references.json'; +import extras from './extras.json'; + +export default { + profile, + objective, + work, + education, + awards, + certifications, + skills, + languages, + references, + extras, +}; diff --git a/src/i18n/source/rightSidebar/actions.json b/src/i18n/source/rightSidebar/actions.json index a610e9ab..b6818714 100644 --- a/src/i18n/source/rightSidebar/actions.json +++ b/src/i18n/source/rightSidebar/actions.json @@ -11,16 +11,17 @@ }, "printResume": { "heading": "Print Your Resume", - "body": "You can simply press <1>Cmd/Ctrl + P at any time while you're in the app to print your resume, but here's a fancy button to do the same thing, just 'cause.", + "body": "You can click on the button below to generate a PDF instantly. Alternatively, you can also use <1>Cmd/Ctrl + P but it would have different effects.", "buttons": { + "export": "Export", "print": "Print" } }, - "loadDummyData": { - "heading": "Load Dummy Data", - "body": "Unclear on what to do with a fresh blank page? Load some dummy data with prepopulated values to see how a resume should look and you can start editing from there.", + "loadDemoData": { + "heading": "Load Demo Data", + "body": "Unclear on what to do with a fresh blank page? Load some demo data with prepopulated values to see how a resume should look and you can start editing from there.", "buttons": { - "loadData": "Populate Data" + "loadData": "Load Data" } }, "reset": { diff --git a/src/i18n/source/rightSidebar/index.js b/src/i18n/source/rightSidebar/index.js new file mode 100644 index 00000000..2560696c --- /dev/null +++ b/src/i18n/source/rightSidebar/index.js @@ -0,0 +1,15 @@ +import templates from './templates.json'; +import colors from './colors.json'; +import fonts from './fonts.json'; +import actions from './actions.json'; +import settings from './settings.json'; +import about from './about.json'; + +export default { + templates, + colors, + fonts, + actions, + settings, + about, +}; diff --git a/src/i18n/source/rightSidebar/settings.json b/src/i18n/source/rightSidebar/settings.json index 12b19981..dacc183c 100644 --- a/src/i18n/source/rightSidebar/settings.json +++ b/src/i18n/source/rightSidebar/settings.json @@ -2,6 +2,6 @@ "title": "Settings", "language": { "label": "Language", - "helpText": "If you would like to help translate the app into your own language, please refer the <1>Translation Documentation." + "helpText": "If you would like to help translate the app into your own language, please refer to the <1>Translation Documentation." } } \ No newline at end of file diff --git a/src/index.css b/src/index.css index 50fce939..a9361314 100644 --- a/src/index.css +++ b/src/index.css @@ -68,7 +68,8 @@ ul li { width: 21cm; min-height: 29.7cm; max-height: 29.7cm; - zoom: 0.8; + transform: scale(0.8); + transform-origin: center; overflow: scroll; background-color: white; } diff --git a/src/templates/pikachu/Pikachu.js b/src/templates/pikachu/Pikachu.js index d3eaa879..ea6ad9aa 100644 --- a/src/templates/pikachu/Pikachu.js +++ b/src/templates/pikachu/Pikachu.js @@ -234,6 +234,7 @@ const Pikachu = () => { return (