Skip to content

Commit

Permalink
fix:image url regex & css
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjaybaskaran01 committed Sep 6, 2021
1 parent e081dbd commit 681a394
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/EventProfile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const EventProfile = ({img,org,title,desc,start,end,url,backgroundColor,textColo
className="border border-gray-900 align-center text-left p-2 mr-2 mb-2 mt-2 w-full h-full sm:h-56 flex-col sm:flex-row"
style={{ backgroundColor,borderRadius:"8px",display:"flex",}}
>
<div className="h-80 w-80 self-center sm:w-48 sm:h-48 my-2 flex items-center justify-center imgdiv">
<div className="h-80 w-80 self-center sm:w-48 sm:h-48 my-2 flex items-center justify-center imgdiv">
<img src={img}
alt={org}
className="object-cover rounded self-center w-full h-full"
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Eventform/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ const EventForm = () => {
<h4>Image/GIF URL</h4>
<input
type="text"
placeholder="Image URL"
placeholder="https://example.com/img.(jpg/gif/png/jpeg)"
name="img"
onChange={(e) => setImg(e.target.value)}
/>
Expand All @@ -238,7 +238,7 @@ const EventForm = () => {
<h4>Event URL</h4>
<input
type="text"
placeholder="Event URL"
placeholder="https://example.com/register"
name="url"
onChange={(e) => setURL(e.target.value)}
/>
Expand Down
1 change: 0 additions & 1 deletion src/pages/Home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const Home = () => {
height="100vh"
eventAdd={events}
eventDisplay={"block"}
// slotLabelFormat={{hour:"numeric",minute:"numeric"}}
eventTimeFormat={{hour:"2-digit",minute:"numeric",omitZeroMinute:true}}
customButtons={{
eventform: {
Expand Down
3 changes: 2 additions & 1 deletion src/pages/Home/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ table {
transition: ease-in 50ms !important;
}

.fc-toolbar {
.fc-header-toolbar {
margin: 1%;
}

Expand Down Expand Up @@ -142,6 +142,7 @@ table {
position:fixed !important;
bottom:0 !important;
width:100% !important;
background-color: #191927 !important;
}
.fc-header-toolbar{
padding:2px 10px !important;
Expand Down
1 change: 1 addition & 0 deletions src/pages/admin/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ const Admin = () => {
href={event.url}
className="flex-no-shrink bg-blue-400 hover:bg-blue-500 px-3 ml-4 py-1 text-xs shadow-sm hover:shadow-lg font-medium tracking-wider border-2 border-blue-300 hover:border-indigo-800 text-white rounded-full transition ease-in duration-300"
target="_blank"
rel="noreferrer"
>
<b></b>
</a>
Expand Down
3 changes: 1 addition & 2 deletions src/validation/eventform.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ const eventFormSchema = Joi.object({
start: Joi.date().error(new Error('Start date must be lower than end date')),
end: Joi.date().min(Joi.ref('start')).error(new Error('End date must be greater than start date')),
url:Joi.string().error(new Error('Invalid URL')),
img:Joi.string().error(new Error('Invalid image URL')),
// img: Joi.string().pattern(new RegExp("https?:\/\/.*\.(?:jpg|gif|png|jpeg)$")).required().error(new Error('Invalid Image URL')),
img: Joi.string().pattern(new RegExp("https?://.*.(?:jpg|gif|png|jpeg)$")).required().error(new Error('Image should be of format jpg,gif,png,jpeg!')),
// url: Joi.string().pattern(new RegExp('https?://(www.)?([-a-zA-Z0-9@:%._+~#=]{1,256}.)+[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)')).required().error(new Error('Invalid event URL')),
org: Joi.string().min(3).max(50).required().error(new Error('Organisation Title should be of min 3 max 50')),
backgroundColor: Joi.string().pattern(new RegExp('^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$')).required().error(new Error('Invalid Background Color')),
Expand Down

0 comments on commit 681a394

Please sign in to comment.