prismicio / prismic-next

Helpers to integrate Prismic into Next.js apps
https://prismic.io/docs/technologies/nextjs
Apache License 2.0
57 stars 7 forks source link

refactor: simplify `<PrismicPreview>` logic #23

Closed angeloashmore closed 2 years ago

angeloashmore commented 2 years ago

Types of changes

Description

This PR refactors <PrismicPreview> to simplify its logic. It removes checks that are not necessary and more strictly handles logic branches.

Checklist:

codecov-commenter commented 2 years ago

Codecov Report

Merging #23 (06f85ff) into main (db8ca22) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main       #23   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8         8           
  Lines          541       528   -13     
  Branches        22        24    +2     
=========================================
- Hits           541       528   -13     
Impacted Files Coverage Δ
src/PrismicPreview.tsx 100.00% <100.00%> (ø)
src/lib/extractPreviewRefRepositoryName.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update db8ca22...06f85ff. Read the comment docs.

github-actions[bot] commented 2 years ago

size-limit report 📦

Path Size
dist/index.js 2.37 KB (-1.07% 🔽)
./dist/index.cjs 7.11 KB (-0.4% 🔽)