v1-import-data-screen.tsx 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import { FC } from 'react'
  2. export type V1ImportData = {
  3. name?: string
  4. status: string
  5. projectId: string
  6. }
  7. export const V1ImportDataScreen: FC<{ v1ImportData: V1ImportData }> = ({
  8. v1ImportData,
  9. }) => {
  10. return (
  11. <div className="loading-screen">
  12. <div className="container">
  13. <div className="row">
  14. <div className="col-sm-8 col-sm-offset-2">
  15. <h1 className="text-center">
  16. {v1ImportData.status === 'mustLogin'
  17. ? 'Please log in'
  18. : 'Overleaf v1 Project'}
  19. </h1>
  20. <img
  21. className="v2-import__img"
  22. src="/img/v1-import/v2-editor.png"
  23. alt="The new V2 editor."
  24. />
  25. {v1ImportData.status === 'cannotImport' && (
  26. <div>
  27. <h2 className="text-center">
  28. Cannot Access Overleaf v1 Project
  29. </h2>
  30. <p className="text-center row-spaced-small">
  31. Please contact the project owner or{' '}
  32. <a href="/contact">contact support</a> for assistance.
  33. </p>
  34. </div>
  35. )}
  36. {v1ImportData.status === 'mustLogin' && (
  37. <div>
  38. <p className="text-center row-spaced-small">
  39. You will need to log in to access this project.
  40. </p>
  41. <div className="row-spaced text-center">
  42. <a
  43. className="btn btn-primary"
  44. href={`/login?redir=${encodeURIComponent(document.location.pathname)}`}
  45. >
  46. Log in to access project
  47. </a>
  48. </div>
  49. </div>
  50. )}
  51. {v1ImportData.status === 'canDownloadZip' && (
  52. <div>
  53. <p className="text-center row-spaced-small">
  54. <strong>{v1ImportData.name || 'This project'}</strong> has not
  55. yet been moved into the new version of Overleaf. This project
  56. was created anonymously and therefore cannot be automatically
  57. imported. Please download a zip file of the project and upload
  58. that to continue editing it. If you would like to delete this
  59. project after you have made a copy, please contact support.
  60. </p>
  61. <div className="row-spaced text-center">
  62. <a
  63. className="btn btn-primary"
  64. href={`/overleaf/project/${v1ImportData.projectId}/download/zip`}
  65. >
  66. Download project zip file
  67. </a>
  68. </div>
  69. </div>
  70. )}
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. )
  76. }